submit contact page then direct flow back to contact us page from a process page

toolmania1

New Member
After submitting data through a form, I use php to show a message that the mail was sent or not sent successfully. Is there a better way to do this?

Also, after that, how can I get back to the index.php page. If I could pass something like

index.php?page=contactUs

Then, I could get back to the main page. But, the mailing and printing of the message is done in a process_contactUs.php page. So, that is not in the normal flow of the page. Basically, if I could sleep(2000) or something so they saw the message, then do a header() redirect by url, that may work. Ideas?
 

chrishirst

Well-Known Member
Staff member
Just make the form "self-submit" and do all the processing in that one URL then you can either show a failure message and repopulate the contact form OR a success message and the contact form unpopulated.
 

Edge

Member
Also, after that, how can I get back to the index.php page.
Show a clear confirmation that the form submission has worked and let them go back to home page themselves - presumably there is a clear link. I hate it when a website starts to take over my navigation. I'd end up on the home page thinking htf did I get here - what happened to my form? What was that message? Did it say the form was submitted successfully? I got distracted and missed the message etc.
 
Top