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.

<meta
  http-equiv='refresh'
  content='0;URL=http://www.juixe.com'>

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

document.location.href='index.html'

Related posts:

  1. TechKnow Year In Review 2005
  2. Search Engine Optimization
  3. Edit Me
  4. Google Web Toolkit Tutorial: The Break Down
  5. HTML FieldSet Tag

This entry was posted in HTML/XML, JavaScript, PHP, TechKnow. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*