redirect url through parameter

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
jaylin
Forum Commoner
Posts: 68
Joined: Fri Nov 18, 2005 4:44 am

redirect url through parameter

Post by jaylin »

i want to redirect from the parameter (login.php?url=main.php).
plz
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

hum.do a switch statement before all output which results in using the link as part of a header command.... need a specific example or is that enough to get ya thinking in the right direction? let me know :-D
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

Code: Select all

header("location: http://www.yourwebsite.com/" . $url . "\n");
Just make sure that is the only output being sent to the browser.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

I don't think the \n is needed on the header, PHP does that for you
jaylin
Forum Commoner
Posts: 68
Joined: Fri Nov 18, 2005 4:44 am

Post by jaylin »

although there is "url" parameter in the address, but, when i use isset method to check exit or not. i always return false. (it return true in the body tab) however, if i want to use header method, it must be in the very first of the page. how can i solive it?
Post Reply