redirect to a new Url?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

Post by serg_dz » 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

Post by ppera » 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

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 4 guests