To do that with PHP, it has to be done before any HTML output occurs.If you want to do it after the original page has loaded, you're better off with javascript. If you still want to do it with PHP, it is done like this:
<? header('Location: otherfile.php');?>
Just remember that in PHP, that has to be done before any HTML output, including empty space.Also, PHP is not a replacement for Javascript. PHP is executed on the server, so there is no interaction with the user on a single page.