I am installing a simple script to process a form. The script is posting all of the data correctly, but it is then suppose to redirect to the thank_you.htm page. The page instead just sits on the feedback.php page blank. If anyone can take a quick look it would be truly appreciated. Full script is listed below: */ // ------------- CONFIGURABLE SECTION ------------------------ // $mailto - set to the email address you want the form // sent to, eg //$mailto = "youremailaddress@example.com" ; $mailto = 'reservations@pleasantharborrv.com' ; // $subject - set to the Subject line of the email, eg //$subject = "Feedback Form" ; $subject = "*****Reservation Request*****" ; // the pages to be displayed, eg //$formurl = "http://www.example.com/feedback.html" ; //$errorurl = "http://www.example.com/error.html" ; //$thankyouurl = "http://www.example.com/thankyou.html" ; $formurl = "http://www.pleasantharborrv.com/Reservation_Request.htm" ; $errorurl = "http://www.pleasantharborrv.com/error.htm" ; $thankyouurl = "http://www.pleasantharborrv.com/thank_you.htm" ; $uself = 0; // -------------------- END OF CONFIGURABLE SECTION --------------- $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $email = $_POST['email'] ; $firstname = $_POST['First_Name'] ; $lastname = $_POST['Last_Name'] ; $address = $_POST['Address'] ; $city = $_POST['City'] ; $state = $_POST['State'] ; $zip = $_POST['Zip_Code'] ; $phone = $_POST['Phone'] ; $arrival = $_POST['Arrival_Date'] ; $departure = $_POST['Departure_Date'] ; $type = $_POST['RV_Type'] ; $length = $_POST['Length'] ; $comments = $_POST['comments'] ; $http_referrer = getenv( "HTTP_REFERER" ); $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $firstname $lastname\n" . "Email: $email\n" . "Address: $address\n" . "Address2: $city $state $zip\n" . "Phone: $phone\n" . "Arrival Date: $arrival\n" . "Departure Date: $departure\n" . "Type of RV: $type\n" . "Length: $length\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; mail($mailto, $subject, $messageproper, "From: \"$firstname $lastname\" <$email>" . $headersep . "Reply-To: \"$firstname $lastname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" ); header( "Location: $thankyouurl" ); exit ; ?>
Try enabling error_reporting. My guess is that you have a space or something in front of your <?php which is causing headers to be sent to the browser before your header() call.