HowToPlaza.com

How to wisdom from across the Internet — want to know how to do something? You may find the solution here.


PHP – page redirection

Do you want to send your visitors to a “Thank you” page after they have filled your form? There are two ways: pay your gratitude on the same PHP page that mails you the form data or redirect to a "thank you" page after the data has been mailed to you. In a normal HTML page you can easily redirect to another page by using this meta tag within the headers tag:

<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/somepage.html">

where 0 means that the browser should wait for zero seconds before redirecting. You can do this in PHP too by simply using this command:

<?php header("Location: yourpage.php"); ?>

You just need to make sure that the browser has sent no header information before this command otherwise you will encounter an error. This basically means you should have not printed anything using either php or HTML on to the browser.

AddThis Social Bookmark Button

Posted by Amrit | Tags: Web Development


You can leave a response, or trackback from your own site.

Leave a Reply