Re: form variables issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can you check the source code?

are there values in source, but it is not displayed on the browser?

<input type=text value=My Name is Richard name=first_name>

check this code snippet

<?php
echo get_magic_quotes_gpc();         // 1
echo $_POST['lastname'];             // O\'reilly
echo addslashes($_POST['lastname']); // O\\\'reilly

if (!get_magic_quotes_gpc()) {
   $lastname = addslashes($_POST['lastname']);
} else {
   $lastname = $_POST['lastname'];
}

echo $lastname; // O\'reilly
$sql = "INSERT INTO lastnames (lastname) VALUES ('$lastname')";
?>

Thanks
Richard

On 1/31/06, All U Want <alluwant@xxxxxxxx> wrote:
>
> Hi folks,
>
> I'm sure it is a very simple question for you but I'm getting almost
> crazy.
>
> I've got a simple form with several form objects, one of them is a
> text field. After submitting the form if one of the form objects
> hasn't been modified I will show the same form but keeping the data
> previously introduced. My problem is the text field, I can't show any
> special characters again, even if there was any space only the first
> word is shown, etc.
>
> I've been playing with different function like urldecode, urlencode,
> stripslashes, htmlspecialchars, etc. but couldn't show the same text.
>
> Do  you know how I can fix this?
>
>
> Thanks a lot,
> David.
>
> Note that magic_quotes_gpc is enabled.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux