I have created a simple form that collects a comment or question from a visitor to my website.
The problem is that if the visitor types:
Your site looks Ok.
I will get that message.
But if the type: Your site needs "Work".
I will get: Your site needs
The script will not send the double quotes or anything after the double quotes
What am I missing???
I have tried:
addslashes()
str_replace()
preg_replace()
with on change to the message.
This is the script
<?php
$recipient = $_POST['recipient'];
$subject = $_POST['subject'];
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$senders_email_address = $_POST['senders_email_address'];
$comments = $_POST['comments'];
$mailheaders .= "To: Thin Dime Web. <$recipient>\n";
$mailheaders .= "From: $first_name $last_name <$senders_email_address>\n";
$body .= "Subject: $subject\n\n";
$body .= "Senders Name: $first_name $last_name\n";
$body .= "E-mail Address: $senders_email_address\n\n";
$body .= "The following Comments or Question came from a visitor to your website\n";
$body .= "\n";
$body .= "$comments\n";
mail("$recipient", "$subject", "$body", "$mailheaders");
?>