vinpkl — 2012-10-27T09:21:40-04:00 — #1
I have this below code for textarea in which person enters his enquiry
<br><br>".htmlspecialchars($name). " had sent you enquiry . ". " \
Person Enquiry = ". htmlspecialchars($enquiry) . " \
after person enters enquiry the email is sent with the enquiry entered.
i receive enquiry content as
testing new site\\r\
how can i use htmlspecialchars in the way it doesnt echoes \r\
felgall — 2012-10-27T17:48:24-04:00 — #2
htmlspecialchars() is for escaping HTML output.
If your email is displaying that text as part of an HTML email then those characters will not be visible.
if you are providing that as a plain text email then you need to get rid of the htmlspecialchars() call so as to not convert it from plain text.
jamescolin — 2012-10-28T02:28:20-04:00 — #3
felgall is right, but perhaps you were wanting to use http://php.net/manual/en/function.strip-tags.php (to remove html tags) instead of htmlspecialchars() but that isn't necessary in a mail() function, at least I don't think there's a security breach possible. Removing html tags is mostly when you want to output user input (not safe) on your webpage.