[PHP] Re: quotes in text strings

2002-10-02 Thread Erwin

Javier Montserat wrote:
> Hi
>
> Single quote's in strings entered via a text input field are
> subsequently appearing with what appears to be an escape character -
>
> comm\'ents
>
> how can i correct this?  I've tried
> htmlspecialchars($string, ENT_QUOTES);
> and
> htmlentities($string, ENT_QUOTES);
>
> but these don't seem to work (maybe its me).

Probably you have magic_quotes_gpc set to On in php.ini...you can change
this to Off, or you can use stripslashes() on the $string variable...

HTH Erwin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: quotes in text strings

2002-10-02 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Hi
> 
> Single quote's in strings entered via a text input field are subsequently 
> appearing with what appears to be an escape character -
> 
> comm\'ents
> 
> how can i correct this?  I've tried
> htmlspecialchars($string, ENT_QUOTES);
> and
> htmlentities($string, ENT_QUOTES);
> 
> but these don't seem to work (maybe its me).

stripslashes() is the immediate solution, but you might also want to 
consider the various 'magic_quotes' settings in your php.ini
 
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php