Hi there, need help on this....TQ very much
The character ' is giving me problem on this
<textarea name="message"></textarea>
whenever i submit the textarea and i echo back the contents
Customer's Name is Johnson
will become
Customer\'s Name is Johnson
That is "abc"
will become
That is \"abc\"
You can choose either\
will become
You can choose either\\
tried with
echo $_Request[ 'message' ] --->produce the red result
$temp = $_Request[ 'message' ];
echo $temp --->produce the red result
Problem with character like ' " /
Moderator: General Moderators
Re: Problem with character like ' " /
try echo "$temp"
Re: Problem with character like ' " /
Won't help in the least bit.
It's called magic quotes. With this INI setting on, PHP automatically runs addslashes on all input, which escapes things like quotes and backslashes.
Turn it off in php.ini, in a .htaccess with
or, as a last resort if you can't do either, run everything through stripslashes before trying to use it, like
It's called magic quotes. With this INI setting on, PHP automatically runs addslashes on all input, which escapes things like quotes and backslashes.
Turn it off in php.ini, in a .htaccess with
Code: Select all
php_flag magic_quotes_gpc offCode: Select all
echo stripslashes($_Request['message']);Re: Problem with character like ' " /
Thank for the reply...got the solutions something like tasairis
if(get_magic_quotes_gpc()){ //check wheher the mgic quotes gpc is tunrned on
$message=stripslashes($_REQUEST[ 'txtMessage' ]);
}else{
//magic quotes gpc is turned off....so not need use stripslashes
$message=$_REQUEST[ 'txtMessage' ];
}
if(get_magic_quotes_gpc()){ //check wheher the mgic quotes gpc is tunrned on
$message=stripslashes($_REQUEST[ 'txtMessage' ]);
}else{
//magic quotes gpc is turned off....so not need use stripslashes
$message=$_REQUEST[ 'txtMessage' ];
}