Wondering if someone could help me out please.
I am using a simple script to mail out on a contact form.
However when it is used and someone fills out a dash or a quote mark, in my email I get backslashes before them.
So for example someone was to write: My name's Fred and you have a "wonderful" website.
It would get sent to looking something like: My name\'s Fred and you have a \"wonderful\" website.
Can someone please tell me how I can get rid of these backslashes?? I have tried str_replace but it just spat out errors.
Expand|Select|Wrap|Line Numbers
- $to = "$myemailadd";
- $subject = "The Subject Line";
- $body = "$message";
- $headers = "MIME-Version: 1.0\r\n";
- $headers .= "Content-Type: text/html; charset=utf-8\r\n";
- $headers .= "From: $name <$email>\r\n";
- $headers .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
- mail($to, $subject, $body, $headers);