Oh man! I feel sorry for the poor guy that actually attempts to read that code! Please make use of the "[ P H P ] [ / P H P ]" tags. They're quite useful!
Secondly, to redirect someone to another page, you should use the header("Location:newlocation.php") command, replacing newlocation.php with where you want them to be redirected to. The only thing with this, is you cannot send any headers before it. (If you use a print/echo/etc statement, it's considered a header thus rendering the header() command redundant.)
The other alternative is to use META tags. Meta can be refreshed any time, it's not as clean as PHP, and not very good programming practice. To use Meta, you could create a function as follows:
function redirect($url,$delay='0') {
print '
<meta http-equiv="refresh" content="'.$delay.';URL='.$url.'">
';
}
//In practice
redirect('newplace.php');
You can use that to redirect to another URL. It will also accept a second parameter of delay.
Hope this helps.
Kevin