Einstein47
Programmer
Hey all,
I have a form where I can enter a message in a textarea and when I click submit the form contents are emailed to me with the mail() function. However, in my message when I use a ' , it will show up in my email as \' .
How do I keep the backslash from showing up?
Here is a snip of my code:
You see the $msgText variable is from the <TEXTAREA name=msgText> tag. What function would I need, and where exactly should I put it?
Any help would be appreciated,
Einstein47
("There are no atheists when restoring from backup."
I have a form where I can enter a message in a textarea and when I click submit the form contents are emailed to me with the mail() function. However, in my message when I use a ' , it will show up in my email as \' .
How do I keep the backslash from showing up?
Here is a snip of my code:
Code:
if ($mailformat == "Text")
{
mail($toText, $subjectText, $msgText, "To: $toText\n"."From: $fromText\n" ."X-Mailer: PHP 4.x");
}
if ($mailformat == "Html")
{
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Me <me@my_email.com>\r\n";
$headers = str_replace("\r", "\n", $headers);
$headers = str_replace("\n\n", "\n", $headers);
$headers = str_replace("\n", "\r\n", $headers);
mail($toText, $subjectText, $msgText, $headers);
}
Any help would be appreciated,
Einstein47
("There are no atheists when restoring from backup."
