Web Hosting Talk







View Full Version : How can I stop php escaping characters in mail()?


tutv
03-23-2003, 02:39 PM
I've set up a form on my site to send to a mail script, which emails to me. But when I recive the email, every character is escaped, eg:

" is turned into \"
' is turned into \'

is there any way to stop this?

Any help appreciated! :cool:

EDIT: I'm using PHP, and mail() to send.

Thanatos
03-23-2003, 03:09 PM
Disable magic_quotes_gpc in your PHP.ini or use stripslashes().

harmonic
03-23-2003, 03:18 PM
i'd use stripslashes()

ie:

$string = stripslashes($string);
mail($to, $subject, $string);

tutv
03-23-2003, 03:29 PM
Thanks!