This sounds like your host has 'Magic Quotes' enabled. This escapes all input into PHP scripts. This feature is frowned upon and is actually being removed in PHP 6. It causes more trouble than it's worth. The best solution here would be to turn off Magic Quotes. If you have access to the php.ini file on your host, turning these directives to off will disable it:
Code:
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off
That is straight from the PHP manual
If you don't have access to the php.ini, this snippet from the php manual will reverse it's effects:
Code:
<?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);
}
?>
Also, here are some related functions for your reference:
get_magic_quotes_gpc() will return 0 if magic quotes is off and 1 if magic quotes is on.
stripslashes() will remove the slashes from a string.
htmlentities() will convert the text into their html equivalents.
Bookmarks