PDA

View Full Version : [php] $_POST variable



eirche
December 3rd, 2004, 09:32 PM
i found an inconsistency between two environments.
on localhost, $_POST['name'] = dave's .
my site remotely, $_POST['name'] = dave\'s .
there is fix for this?

ironikart
December 3rd, 2004, 09:58 PM
use:


$_POST['name'] = stripslashes($_POST['name']);

eirche
December 3rd, 2004, 10:52 PM
thx

i learned something from stripslashes() documentation. i set "magic_quotes_gpc = on" in php.ini to make things consistent.

λ
December 4th, 2004, 03:23 AM
thx

i learned something from stripslashes() documentation. i set "magic_quotes_gpc = on" in php.ini to make things consistent.
The best way to do it is something like this:



if (get_magic_quotes_gpc ())
stripslashes ($_POST['dave');

[m]
December 4th, 2004, 11:21 PM
The best way to do it is something like this:



if (get_magic_quotes_gpc ())
stripslashes ($_POST['dave');


No, the best way is to leave ' get_magic_quotes_gpc' off.