This contact.php form worked to handle sending, then redirecting to a new page, and then suddenly just stopped working. I tried to add error handling as well as move the header at the top in front of all the others, but none of them work. The form is still submitting data, as expected, it's just a redirect that doesn't work. Any ideas would be appreciated.
<?php include 'config.php'; $post = (!empty($_POST)) ? true : false; if($post) { $email = trim($_POST['email']); $subject = "Downloaded Course Units"; $error = ''; if(!$error) { $mail = mail(WEBMASTER_EMAIL, $subject, $message, "From: ".$email."\r\n" ."Reply-To: ".$email."\r\n" ."X-Mailer: PHP/" . phpversion()); if($mail) { echo 'OK'; header('location: http://www.google.com.au/'); exit(); } } } ?>
php header location
dee_styles
source share