I have searched and searched for an answer to what I am doing wrong. I have used Swishmax to make a form which is here http://www.fortworthmovers.com/form.htm and once the submit button is pressed I have the information sent to 2 different email addresses. This part works fine, but I want it to redirect to a thank you page which is here http://www.fortworthmovers.com/thankyou.htm. But nothing happens when the submit button is pressed (other than the info being emailed). How can I get it to redirect to the thank you page?
I am a newb in PHP, obviously…Here is the PHP file that I am using:
[php]<?php $name = $HTTP_POST_VARS['Name']; $email = $HTTP_POST_VARS['Email']; $phoneday = $HTTP_POST_VARS['Phoneday']; $phonenight = $HTTP_POST_VARS['Phonenight']; $movedate = $HTTP_POST_VARS['Movedate']; $fromaddr = $HTTP_POST_VARS['Fromaddr']; $tomaddr = $HTTP_POST_VARS['Toaddr']; $comments = $HTTP_POST_VARS['Comments']; $referred = $HTTP_POST_VARS['Referred']; $comments = stripslashes($comments); $referred = stripslashes($referred); $sendTo = "firstname.lastname@example.org"; $sendTo2 = "email@example.com"; $subject = "Message from Contact Form"; $msg_body = "1. Name: $namen"; $msg_body .= "2. E-Mail: $emailn"; $msg_body .= "3. Phone_day: $phonedayn"; $msg_body .= "4. Phone_night: $phonenightn"; $msg_body .= "5. Move_date: $movedaten"; $msg_body .= "6. From_address: $fromaddrn"; $msg_body .= "7. To_address: $tomaddrn"; $msg_body .= "8. Comments: $commentsn"; $msg_body .= "9. Referred: $referredn"; $info = "From: ".$name." <".$email.">"; mail($sendTo, $subject, $msg_body, $info); mail($sendTo2, $subject, $msg_body, $info); header("Location: http://www.fortworthmovers.com/thankyou.htm"); exit; ?>
Thank you for your help!!!
Admin Edit: Added [php] tags for readability. Please see http://phphelp.com/guidelines.php for posting guidelines.