Hey guys,
I have a form that is handled by a PHP script. The script processes the data from the form and sends an e-mail with the data to an e-mail address. Pretty simple. The problem is that the $msg isnt including all the data that it should be, its only sending the last line which is the $_FORM['inquiry']. These are not being included: firstname, lastname, company, phone, and email.
Check it out and help if you can:
<?php
$msg = "First Name:\t".$_POST['firstname']."\n";
$msg = "Last Name:\t".$_POST['lastname']."\n";
$msg = "Company:\t".$_POST['company']."\n";
$msg = "Phone Number:\t".$_POST['phone']."\n";
$msg = "E-mail Address:\t".$_POST['email']."\n";
$msg = "Inquiry:\t".$_POST['inquiry']."\n";
$recipient = "webmaster@adomainname.com";
$subject = "VISITOR INQUIRY from thewebsite.com";
$mailheaders = "From: Visitor inquiry via thewebsite.com frontpage\n";
$mailheaders = "Reply-To:". $_POST['email']."\n\n";
mail($recipient, $subject, $msg, $mailheaders);
echo "<HTML><HEAD><TITLE>Request Sent!</TITLE><meta http-equiv=\"Refresh\" content=\"5; ; URL=http://www.backtothewebsite.com\"></HEAD><BODY>";
echo "<H1 align=center>Thank you $_POST[firstname],</H1>";
echo "<P align=center> your inquiry was sent.</P>";
echo "<P align=center> your inquiry will be reviewed and you will be contacted if need be, thank you.</P>";
echo "</BODY></HTML>";
?>