Bruce Gust
asked on
PHP TinyMCE email snaffuu
Attached is a screenshot of an email that's generated from the following code:
$the_name=stripslashes($_P OST['name' ]);
$the_comment = stripslashes($_POST['body' ]);
$the_comment = str_replace("<P>", "\r\n", "$the_comment");
$the_comment = str_replace("</P>", "", "$the_comment");
$to = "prayer@trinityspringhill. org";
$subject = "prayer request";
$message = "$the_name emailed you with the following prayer request:\n\n$the_comment";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers = "From: prayer@trinityspringhill.o rg\r\n" ."X-Mailer: php";
if (!mail($to, $subject, $message, $headers)) {
echo("<p>Message delivery failed...</p>");
}
I'm having a hard time eliminating the <P> garbage. I've tried html_entity_decode and anything else I can think of to no avail.
The tinymce dynamic has been a blessing and a problem in the way it insert line breaks, but surely there's a way to prevent these characters from showing up on the email.
What am I missing?
$the_name=stripslashes($_P
$the_comment = stripslashes($_POST['body'
$the_comment = str_replace("<P>", "\r\n", "$the_comment");
$the_comment = str_replace("</P>", "", "$the_comment");
$to = "prayer@trinityspringhill.
$subject = "prayer request";
$message = "$the_name emailed you with the following prayer request:\n\n$the_comment";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers = "From: prayer@trinityspringhill.o
if (!mail($to, $subject, $message, $headers)) {
echo("<p>Message delivery failed...</p>");
}
I'm having a hard time eliminating the <P> garbage. I've tried html_entity_decode and anything else I can think of to no avail.
The tinymce dynamic has been a blessing and a problem in the way it insert line breaks, but surely there's a way to prevent these characters from showing up on the email.
What am I missing?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.