Page Redirect

I totally forgot how to redirect to another page using PHP. After trying to remember I had to look it up in the PHP documentation. So if you want to redirect to another page using PHP you write to the header using this bit of code:

header('Location: index.html');

I opted to use PHP solution instead of the HTML meta refresh tag. You can do the same thing by placing this tag in your html output.


Of course, you can redirect to another page in just about in every language, including JavaScript as this snippet of JavaScript code demonstrates it:


Leave a Reply