I've made a email script that sends the users information that was filled out in our forms. But we noticed that when we send any information using " or ' that it adds a \' or \" to the email. Now I understand that PHP requires \'s to keep it from breaking prematurely but is there any way around this?
Here's an Example of my issue... Daugherty\'s Contruction
//SEND EMAIL TO name@website.com
$to = "name@website.com";
$subject = "Sending Company Name - Receipt " . $_POST['company'];
$header = "From: name@website.com" . "\r\n";
$header .= "Reply-To: " . $_POST['email'] . "\r\n";
$header .= "MIME-Version: 1.0" . "\r\n";
$header .= "Content-type: text/html;charset=iso-8859-1" . "\r\n";
$message = "<html>
<body>
<img alt='Logo' src='http://www.website.com/logo.png'/>
<h2>
Customer Payment
</h2>
<p><b>Company: </b>" . $_POST["company"] . "</p>
<p><b>Name: </b>" . $_POST['first_name'] . " " . $_POST['last_name'] . "</p>
<p><b>Email: </b>" . $_POST['email'] . "</p>
<p><b>Phone: </b>" . $_POST['phone'] . "</p>
<p><b>Location: </b>" . $_POST['city'] . ", " . $_POST['state'] . " " . $_POST['zip'] . "</p>
<p><b>Date: </b>" . $today = date('F j, Y - g:i A (T)') . "</p>
<p><b>Card Used: </b> XXXX-XXXX-XXXX-" . $last4 . "</p>
<p><b>Payment Amount: </b>$" . $_POST['price'] . "</p>
<br/>
<p>http://www.website.com/payment</p>
</body>
</html>";
mail($to, $subject, $message, $header);