I am having problem with my emails if characters like " ' are in the body of my message using the <textarea> tag for the message body. When my recipient recievs the email this is what happens, if I had a word like wasn't it becomes wasn\'t this problem occurs in both plain text and Html messages using the <textarea>. but if the mesage has already been defined in my php script for example
$messaeg = <<<ABC
Thi is a place wasn't bad the last time I visited
ABC;
I don't exprience the problem.
So I will like to know if any additional header could be added to my mailing script to help eradicate this problem in HTML and Plian text messages.
Problem with PHP mailing script
Moderator: General Moderators
-
magosla2001
- Forum Newbie
- Posts: 20
- Joined: Sat May 20, 2006 8:54 am
Problem with PHP mailing script
Last edited by magosla2001 on Sat May 20, 2006 10:41 am, edited 1 time in total.
The problem you're experiencing is the fact that you (or your isp) has enabled magic_quotes... Ask them to disable it because it messes up your data (in a way that it shouldn't...)... Otherwise you can also 'undo' the mess (sample code can be found at http://www.nyphp.org/phundamentals/stor ... ieving.php)
Code: Select all
if (get_magic_quotes_gpc()) {
$in = array(&$_GET, &$_POST, &$_COOKIE);
while (list($k,$v) = each($in)) {
foreach ($v as $key => $val) {
if (!is_array($val)) {
$in[$k][$key] = stripslashes($val);
continue;
}
$in[] =& $in[$k][$key];
}
}
unset($in);
}