Hi everyone, I posted last week regarding a problem i had with my form, Ive gone away, and took the time to get my php working as well as i can, only problem now, is when i submit my form, it keeps saying all fields need to be filled in, but everything is filled in, could one of you experts please take a look at my code tell me where im going wrong. <?php $txtFirstName=$_POST["txtFirstName"]; $surname=$_POST["surname"]; $txtAddress1=$_POST["txtAddress1"]; $txtAddress2=$_POST["txtAddress2"]; $postcode=$_POST["postcode"]; $txtCountry=$_POST["txtCountry"]; $txtTelephone=$_POST["txtTelephone"]; $txtMobile=$_POST["txtMobile"]; $txtEmail=$_POST["txtEmail"]; $txtproduct=$_POST["txtproduct"]; $brochure=$_POST["brochure"]; $radContactby=$_POST["radContactby"]; If ((!$txtFirstName) || (!$surname) || (!$txtAddress1) || (!$txtAddress2) || (!$postcode) || (!$txtCountry) || (!$txtMobile) || (!$txtEmail) || (!$txtproduct) || (!$radContactby) || (!$brochure) || (!$txtTelephone)) { echo(" <center>Sorry,all the fields must be filled out.</center>"); } else { $body1 ="Name : ".$txtFirstName." ".$surname." Address : ".$txtAddress1." ".$txtAddress2." Postal code : ". $postcode." country : ".$txtCountry." Telephone : ".$txtTelephone." Mobile phone : ".$txtMobile." Email: ".$txtEmail." Chosen product :". $txtproduct." ".$brochure." Preffered contact : ".$radContactby; $to = "smnfowler@aol.co.uk"; $subject ="CentreofAttention"; $body = $body1; if (mail($to, $subject, $body)) { echo(" <center>Thank you!Email sent!</center>"); } else { echo(" Message delivery failed...</p>"); } } ?> your help will be much appreciated Flowster if you need to see the form it is at www.centreofattentionuk.com
You should put some display to see if some or no values are filled in. If none, you should consider to take a look at the posting script which would be the one responsible for the filling of these variables.
You should also scan for invalid or spam email headers in your input, like Bcc:, then ban any IPs that try and send them. I had a spam issue on my site from that. Also use a verification image.