Hey all
Sorry for becoming a new member and then pasting this but I’ve started a new job in I.T and I’ve been asked to work on the company website even though I have no idea about PHP/HTML so I need to become a fast learner! Any help will be muchly appreciated.
Basically on the contact us form on the website, a PHP script emails us the form which works fine except it misses out two lines which is should have filled in? I cannot see any errors and dreamweaver reports that the syntax is all good.
Would somebody mind taking a look at the coding and see if you can spot anything wrong?
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
Your Message:
PHP SCRIPT
<?php //Email Details $EmailFrom = "[email protected]"; $EmailTo = "[email protected]"; $Subject = "Website Contact Form Submission"; $Name = Trim(stripslashes($_POST['Name'])); $Email = Trim(stripslashes($_POST['Email'])); $Comments = Trim(stripslashes($_POST['Comments'])); // 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 ""; } ?>Email Arrives like this:
Name: test
Company Name:
Phone Number:
Email: [email protected]
Message: sdfdsfs
Basically the email arrives as shown but it’s missing the Phone Number and Company name details? I think this code has been borrowed when the website made so it’s been changed to suite our needs.
Thanks for taking the time to look at this!