Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    php
  » PHP Redirect
      by sde
 Page 1 of 1 
   

(Login to remove green text ads)
PHP Redirect - How To
PHP Redirects are a great way to move a user from one page to the next automatically. Of course you could do this with a meta redirect, or a javascript redirect, but the advantage of a PHP Redirect is that it is transparent to the user. In other words, it happens immediately.

A PHP Redirect is pretty simple, but there is one important rule to remember. This is a header function, and absolutely nothing, including white space, can be printed to the browser before the code with the redirect executes.

See the code below:
PHP Code:
<?
header
("location: http://somedomain.com/somepage.php");
?>
Yes, it is as simple as that!

Happy Coding :)




 
 Page 1 of 1 
   

Rate This Article
1 2 3 4 5 6 7 8 9 10





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle