redirect to a new Url?

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 13
Joined: Thu Oct 10, 2002 10:37 pm
Location: Ukraine

Wed Jan 08, 2003 11:25 pm

Use something like this:

header("Location: admin_menu.php?uid=$uid&sid=$sid");

User avatar
New php-forum User
New php-forum User
Posts: 11
Joined: Thu Jan 09, 2003 2:11 pm

Thu Jan 09, 2003 2:19 pm

Better way is this:
print"<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=$page\">"; die;

This automatically redirects always, while header("Location.... works only if no html output is sent.

Statement die after prevents execution of further code if redirect is conditional.

Post Reply