cfgcjm Posted September 30, 2007 Author Share Posted September 30, 2007 ok i fixed the session_start() is there another command that i can use to redirect to a page? Quote Link to comment https://forums.phpfreaks.com/topic/71285-form-emailer-will-not-reach-success-page/page/2/#findComment-358703 Share on other sites More sharing options...
shocker-z Posted September 30, 2007 Share Posted September 30, 2007 can use a bit of dirty html code but some browsers may have this blocked <? session_start(); $name = $_POST["name"]; $email = $_POST["email"]; $person = $_POST["person"]; $reason = $_POST["reason"]; $today = date("d, M Y"); $recipient = "millercj@etown.edu"; $subject = "Prayer Request"; $forminfo ="From: $name\nEmail: $email\nForm Submitted: $today\nPerson to add: $person\nReason: $reason\n\n"; $sent = mail($recipient, $subject, $forminfo, "From: $email"); if($sent) { echo '<meta http-equiv="refresh" content="0;URL=http://www.stjohnsuccjonestown.org/portal/requestsuccess.php">'; else { echo '<meta http-equiv="refresh" content="0;URL=http://www.stjohnsuccjonestown.org/portal/requestno.php">'; } ?> Liam Quote Link to comment https://forums.phpfreaks.com/topic/71285-form-emailer-will-not-reach-success-page/page/2/#findComment-358704 Share on other sites More sharing options...
cfgcjm Posted September 30, 2007 Author Share Posted September 30, 2007 Well...Firefox & Internet Explorer support that so as much as it irritates me to say it; i'm gonna give up and take the easy way out with the html. Thanks for all your help...and sorry for the confusion Quote Link to comment https://forums.phpfreaks.com/topic/71285-form-emailer-will-not-reach-success-page/page/2/#findComment-358708 Share on other sites More sharing options...
NottaGuru Posted October 1, 2007 Share Posted October 1, 2007 I have an off the wall idea... Use a variable. If message sent, $Success=1, message failed, $Success=0. Then down in the code, use if statements. if($Success==1) { $ShowForm=0; Do this } if($Success==0) { $ShowForm=1; //Show the form again with the errors Do this } For the form processing, try action to self and at the top of the page, try an isset for the submit button and 'include' the error checking and then if no errors, change the variable values. if($ShowForm==1) { Show the form } else { Don't show the form. Show something else. } Confused yet? Hopefully this helped. Quote Link to comment https://forums.phpfreaks.com/topic/71285-form-emailer-will-not-reach-success-page/page/2/#findComment-358769 Share on other sites More sharing options...
shocker-z Posted October 1, 2007 Share Posted October 1, 2007 I have an off the wall idea... Use a variable. If message sent, $Success=1, message failed, $Success=0. Then down in the code, use if statements. if($Success==1) { $ShowForm=0; Do this } if($Success==0) { $ShowForm=1; //Show the form again with the errors Do this } For the form processing, try action to self and at the top of the page, try an isset for the submit button and 'include' the error checking and then if no errors, change the variable values. if($ShowForm==1) { Show the form } else { Don't show the form. Show something else. } Confused yet? Hopefully this helped. if you look back through the thread i echo'ed stuff back and it was checking if it had sent or not as it got to success and echo'ed success but it was the header() that wasn't working nor returning an error message. Liam Quote Link to comment https://forums.phpfreaks.com/topic/71285-form-emailer-will-not-reach-success-page/page/2/#findComment-358896 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.