Nap
03-20-2007, 05:41 PM
Hi guys,
I have a textarea in my html form where the user enters text. The form is posted back to the php page that is processing it.
The php then sends the typed text to various users via email. In addition to sending the email, I store the typed text into a MySQL table, after parsing it with nl2br(htmlspecialchars($_POST[comments])).
The problem I have is that if the user types a ' character in the textarea, the $_POST[comment] field returns with the ' escaped to \' and the email sent has the \ character in it. However, the data stored in MySQL is fine.
I've tried using the result from htmlspecialchars($_POST[comments]) in my email, but it still shows the \.
How can I make the \ not show in the email?
Cheers,
Nap
I have a textarea in my html form where the user enters text. The form is posted back to the php page that is processing it.
The php then sends the typed text to various users via email. In addition to sending the email, I store the typed text into a MySQL table, after parsing it with nl2br(htmlspecialchars($_POST[comments])).
The problem I have is that if the user types a ' character in the textarea, the $_POST[comment] field returns with the ' escaped to \' and the email sent has the \ character in it. However, the data stored in MySQL is fine.
I've tried using the result from htmlspecialchars($_POST[comments]) in my email, but it still shows the \.
How can I make the \ not show in the email?
Cheers,
Nap