Contact.php Form Issue -


having trouble contact.php form. seems working intermittently , can't spot doing wrong.

hosting godaddy , said add following not sure relay-hosting.secureserver.net

any or references building 1 of these helpful. current code below.

<?php  if(isset($_post['email'])) {  // edit 2 lines below required $email_to = "info@resonatebusiness.com"; $email_subject = "new website inquiry";   $email_message = "form details below.\n\n";  function clean_string($string) {   $bad = array("content-type","bcc:","to:","cc:","href");   return str_replace($bad,"",$string); }  $email_message .= "first name: ".clean_string($full_name)."\n"; $email_message .= "last name: ".clean_string($email)."\n"; $email_message .= "email: ".clean_string($email)."\n"; $email_message .= "telephone: ".clean_string($subject)."\n"; $email_message .= "comments: ".clean_string($message)."\n";   $headers = 'from: '.$email_from."\r\n".  'reply-to: '.$email_from."\r\n" .   'x-mailer: php/' . phpversion();   @mail($email_to, $email_subject, $email_message, $headers);     header("location: http://www.publishingpush.com");   exit;   ?> 

you redirecting form before mail sent. redirect after successful mail function execution.

if( mail($email_to, $email_subject, $email_message, $headers) ){  //redirect } 

Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -