Hi All
Now our contact us page is working, we would like some feedback from users who contact us via the web page. I’d like to add a simple drop down box asking users where they hear of us but it doesn’t work.
I’d like to embed the code into the existing HTML form and PHP script but what I thought was correct actually doesn’t do anything.
Here is the code
HTML FORM:
Contact Us
Please fill out the following form to contact us.
Your Name:
*required
Company Name:
*required
Phone Number:
*required
Your Email:
*required
How Did You Hear About Us?
Internet
Word Of Mouth
Flyer
Never Heard Of Us
Your Message:
PHP SCRIPT:
<?php //Email Details $EmailFrom = "**@**.co.uk"; $EmailTo = "**@**.co.uk"; $Subject = "Website Contact Form Submission"; $Name = trim(stripslashes($_POST['Name'])); $Email = trim(stripslashes($_POST['Email'])); $Comments = trim(stripslashes($_POST['Comments'])); $Company = trim(stripslashes($_POST['Company'])); $Phone = trim(stripslashes($_POST['Phone'])); $How = trim(stripslashes($_POST['How'])); // prepare email body text $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Company Name: "; $Body .= $Company; $Body .= "\n"; $Body .= "Phone Number: "; $Body .= $Phone; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Message: "; $Body .= $Comments; $Body .= "\n"; // send email $success = mail($EmailTo,$Subject,$Body, "From: <$EmailFrom>"); // redirect to success page // CHANGE THE URL BELOW TO YOUR "THANK YOU" PAGE if ($success){ print ""; } else{ print ""; } ?>Thanks for looking