think-digitally Posted June 12, 2008 Share Posted June 12, 2008 Hi. I have a contact form. When the form is submitted, I want it to forward to a sent page. Can anyone show me how I would do this with the code. Heres the code <?php if(isset($_POST['submit'])) { $to = "[email protected]"; $subject = "Print Requet - David Clapp Photography"; $name_field = $_POST['name']; $email_field = $_POST['email']; $printname = $_POST['printname']; $message = $_POST['message']; $option = $_POST['radio']; $option2 = $_POST['radio2']; $dropdown = $_POST['drop_down']; $body = "From: $name_field\n E-Mail: $email_field\n Photo Name: $printname\n Postage: $option\n Payment: $option2\n Print Size: $dropdown\n Message:\n $message\n"; echo "Data has been submitted to $to!"; mail($to, $subject, $body); } else { echo "Error, Please try again later"; } ?> Link to comment https://forums.phpfreaks.com/topic/109974-solved-how-can-i/ Share on other sites More sharing options...
wildteen88 Posted June 12, 2008 Share Posted June 12, 2008 What do want to happen on the sent page? To redirect a user use header: header('Location: page_to_be_redirect_to.php'): Link to comment https://forums.phpfreaks.com/topic/109974-solved-how-can-i/#findComment-564320 Share on other sites More sharing options...
think-digitally Posted June 12, 2008 Author Share Posted June 12, 2008 dont mean to come accross stupid, but were in the script would I place the header? Link to comment https://forums.phpfreaks.com/topic/109974-solved-how-can-i/#findComment-564325 Share on other sites More sharing options...
wildteen88 Posted June 12, 2008 Share Posted June 12, 2008 I presume you want the user to be redirected after the email has been sent? If so add it after you call mail function. Link to comment https://forums.phpfreaks.com/topic/109974-solved-how-can-i/#findComment-564331 Share on other sites More sharing options...
think-digitally Posted June 12, 2008 Author Share Posted June 12, 2008 Fantastic works. Thankyou. Link to comment https://forums.phpfreaks.com/topic/109974-solved-how-can-i/#findComment-564333 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.