Redirecting a page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
feiticeir0
Forum Newbie
Posts: 8
Joined: Tue Nov 05, 2002 1:33 pm
Location: Castelo Branco, Portugal

Redirecting a page

Post by feiticeir0 »

Hi! How can i redirect the browser automaticaly to another page ?

example:
in the login, is the administrator, and, by a switch condition
i want the browser to go to another page


"if (login == administrator)
goto another page ...

how to do this ?

regards,
Bruno Santos
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

<?php

if ($login == 'administrator')
{
header("Location: http://theaddress.com");
exit;
}
else
{
header("Location: http://wrongloginaddress.com");
exit;
}

?>
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Before using the function don't forget to read

viewtopic.php?t=1157
Post Reply