tags:

views:

94

answers:

2

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
magic quotes cannot be disabled in a .htaccess
Mez
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
+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
Thanks a lot..... Problem solved
halocursed