Instant Redirection
When you are ready to redirect the user, insert
this snippet.
Code:
<?php
header('Location: http://www.google.com');
?>
Of course replacing google.com with the site you
wish to redirect to.
Another method of redirecting using the header function
is doing an internel redirect. An internel redirect
is redirecting to a page somewhere in your site.
For example:
Code:
<?php
header('Location: home.php');
?>
Would then redirect to home.php. You can try that,
replacing home.php with the page you with to redirect
to. Note, this method will only work to redirect inside
your site, not to an externel site.
You can even time redirect a user, redirecting in
a preset number of seconds, using this method.
Code:
<?php
header('Refresh: 0; url=http://www.example.net' );
?>
The above method will redirect to an externel site.
THe command 'Refresh: (# of seconds)' determines how
many seconds are elapsed before the user gets redirected.
To redirect internally using the refresh function,
use this method:
Code:
<?php
header('Refresh: 3; url=/');
?>
This method will redirect to what the server assumes
the homepage is (/).
To read up more on the header function, go here:
http://us3.php.net/header