Hello I have a simple question but it might be late so that might be why I can't figure it out. I have put together just a simple contact form. I have the normal stuff added like email, subject, message, etc. I want to add the name and have it show up in the message but I have forgot how to do this. I have it set up in the html form and made a variable for it but it doesn't work unless I remove the name variable from the php script, otherwise it works great.
Here is the html form.....
<form method="post" action="contact.php">
Name<BR>
<INPUT TYPE="text" NAME="name" SIZE="40"><BR>
E-mail address<BR>
<INPUT TYPE="text" NAME="email" SIZE="40"><BR>
Subject<BR>
<INPUT TYPE="text" NAME="subject" SIZE="40"><BR>
Your message<BR>
<TEXTAREA NAME="message" COLS="40" ROWS="5"></TEXTAREA><BR>
<INPUT TYPE="submit" VALUE="Send">
<INPUT TYPE="reset" VALUE="Reset">
</FORM>
Here is the php script....
<?php
$to = "nospam@removed.com";
$subject = "Mesquite Christmas Inquiry";
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $name, $message, $headers) ;
if($sent)
{print "Thank You, Your e-mail was successfully sent. We will be back in contact with you as soon as possible"; }
else
{print "We encountered an error sending your e-mail. Please check the form and try again."; }
?>
Here is a link to the contact page. I would like to keep the form as is, but I am open for an easier or better suggestion on the php script.
http://www.mesquitechristmas.com/contact_us.html
Any help would be greatly appreciated.
-Thanks