denoteone Posted October 21, 2008 Share Posted October 21, 2008 so far I have this in my mail.php file $name = $_POST['name']; $email = $_POST['email']; $comments = $_POST['message']; $message = 'The following email came in from '.$name.'<br><br> '.$comments.''; $subject = "Mail From Head Nods"; $headers = 'From: '.$email.'\r\n'; $headers .= "Reply-To:*******@gmail.com\r\n"; $headers .= "Content-type: text/html\r\n"; mail('*******@gmail.com',$subject,$message,$headers); now after the mail is sent I want the user to be sent to thankyou.html Link to comment https://forums.phpfreaks.com/topic/129449-solved-redirect-after-mail-is-sent/ Share on other sites More sharing options...
genericnumber1 Posted October 21, 2008 Share Posted October 21, 2008 add header('Location:thankyou.html'); that was easy enough.. you may need to include the url in front of thankyou.html, I don't recall. Link to comment https://forums.phpfreaks.com/topic/129449-solved-redirect-after-mail-is-sent/#findComment-671165 Share on other sites More sharing options...
n3ightjay Posted October 22, 2008 Share Posted October 22, 2008 A little more if(mail('*******@gmail.com',$subject,$message,$headers)){ header('Location: /thankyou.php'); }else{ header('Location: /error.php'); } Just checks to make sure there wasn't an error sending the mail and having the user get hung up on an error page Link to comment https://forums.phpfreaks.com/topic/129449-solved-redirect-after-mail-is-sent/#findComment-671483 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.