I have read all your posts about inserting headers into a php form file in order to redirect the user to another URL AFTER the form is submitted - but I can't figure out how to do it. Below is my code. Can you show me where to put the header/redirect so that the information gets e-mailed and then the user goes to another html page?
Thanks for subscribing to our mailing list
how to redirect a url? or how to redirect a page to another page? It is basic requirements of any website that was made in PHP or other languages. Today Redirection is an essential part of recent website. In redirection, you can actually divert your user to a particular page of your website.
For example, If user is working on your website and user wants to submit a comment or logged in/logged out on your website, then you should have to redirect to thank you page or user profile page if user wants to logged in.
PHP provides a simple and clean way to redirect visitors to another page.
Now in PHP, redirection is done by two types.
- Using header[] function
- Using
PHP code to redirect page:
- Create HTML code for sending information to server
Title of page
- Create PHP code for giving response of HTML form
- HTML code for thank you page
Page Title
Thank you!
This is a simple PHP script for redirection one page to another page. Firstly we have sent input values like name, email and message by html form tag after that we used PHP script for checking and retrieving input fields value through POST method, which is only possible if we submit the form.