Error when Sending PHP Contact Form -


Hope you can help me first, let me clarify that I have very little PHP knowledge, I know that How to edit PHP, so that I can add my information (email for a contact form) but not really a php coder. My respect goes to experts like you & amp; I hope you can help me

I am using a simple php contact form that validates the entered information (to ensure that some fields are entered). It works perfectly until this point - it is validating that the information has been entered ... if it does not provide an error message that tells you that you have to enter certain types of information.

My error .. It is when all fields are registered & amp; You press the submit button ... the page that sends this information does not load & amp; I'm not sure what's wrong with the blank page & amp; This happens only when the message has to be sent (there is no error while validating the field).

Please see the code below. Thank you.

  & lt ;? Start the variable to start php // $ Name = ""; // sender name $ email = ""; // sender's email id $ phone = ""; // mail message $ message = ""; // sender's message $ nameError = ""; $ Email error = ""; $ PhoneError = ""; $ Message error = ""; $ SuccessMessage = ""; // The work will be executed on submitting the form below. If (isset ($ _ POST ['submit'])) / // Check the zero values ​​in the message if (empty ($ _ POST ["name"])) {$ nameError = "name is required"; } And {$ name = test_input ($ _ POST ["name"]); // Check name contains only letters and white space (! Preg_match ("/ ^ [a-zA-Z] * $ /", $ name) {$ nameError = "Letters and white space are allowed only" ; }} // Check the zero values ​​in the message if (empty ($ _ POST ["email"])) {$ emailError = "email is required"; } And {$ email = test_input ($ _ POST ["email"]); } // Checking the zero values ​​in the message if (empty ($ _ POST ["phone"])) {$ phoneError = "Your phone number is required"; } And {$ phone = test_input ($ _ POST ["phone"]); } // Check the zero values ​​in the message if (empty ($ _ POST ["message"])) {$ messageError = "Message Required"; } And {$ message = test_input ($ _ POST ["message"]); } // Check the zero values ​​in the message if (! ($ Name == '') & amp;! ($ Email == '') & amp;! ($ Phone == '') & amp; ($ Message == '')) {// Validate email checking if preg_match ("/ ([\ w \ -] + \ @ [\ w \ -] + \. [\ W \ -] +) / ", $ Email) {$ header = $ name." & Lt; ". $ Email." & Gt; "; $ header =" ab@abc.com "; / * e-mail * / $ msg =" hello ! $ Name ... for creating a message ... Thank you for contacting us Name: $ name Email: $ Email Phone: $ Phone Message: $ Message We Will Contact You as soon as possible ( Usually 24 hours or less). "; $ Msg1 =" $ name Name: $ name Email: $ Email Phone: $ Phone Message: $ Message "; / * Mail () Function * / if (Mail ($ Email, $ Header, $ msg) & mail ("abc@abc.com", $ header, $ msg1)) {$ successMessage = "Message has been successfully sent ......." ;}} And {$ emailError = "invalid email";}}} function to filter // input values. Function test_input ($ data) {$ data = trim ($ data); $ Data = stripsash ($ data); $ Data = htmlspecialchars ($ data); $ Return data; }? & Gt;  

All the best, Anton


Comments