When I submit data in my form it changes "abcd" to \"abcd\" on the other end.How can I overcome this problem... (I am using post method to send data)..... Please help...Thanks
A:
That are probably Magic Quotes. You can disable them by disabling magic_quotes_gpc
(either in a .htaccess file or in the server configuration).
Gumbo
2009-07-12 12:24:56
magic quotes cannot be disabled in a .htaccess
Mez
2009-07-12 12:27:43
It *can* be disabled in a .htaccess file if PHP runs as Apache module. The *Changeable* value of `magic_quotes_gpc` is *PHP_INI_PERDIR* (see http://docs.php.net/manual/en/info.configuration.php).
Gumbo
2009-07-12 12:38:57
+8
A:
This is generally due to magic_quotes.
Something similar to
<?php
if (get_magic_quotes_gpc()) {
function stripslashes_deep($value)
{
$value = is_array($value) ?
array_map('stripslashes_deep', $value) :
stripslashes($value);
return $value;
}
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}
?>
Should switch them off. I'd reccomend switching them off in your configuration though..
http://us2.php.net/manual/en/security.magicquotes.disabling.php
Mez
2009-07-12 12:26:21