<?php
header("Refresh: 3; URL=/index.phpnn");
echo " "; // NN4 requires that we output something...
exit();
?>
If you didn't want a timed redirect then you could use this:
code:
header("Location: ADDRESS");
Make sure that you do not output to the browser before you perform the redirection. Your attempt at redirection will fail if you output anything with a message similar to
quote:Cannot modify header information - headers already sent by (output started .....)
This means that the redirection must be found before any HTML code.
This includes newlines in any includes you may have, or newlines before the first <?php.
As of writing this FAQ is number 2 at Google in the search for the terms php, redirect (up from 9) and 9 for the terms php, redirect, page (previously 14).