php redirect...

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
batfastad
Forum Contributor
Posts: 433
Joined: Tue Mar 30, 2004 4:24 am
Location: London, UK

php redirect...

Post by batfastad »

Is there a way to do a PHP redirect?

At the moment I do meta redirects, not ideal!!

Is there a better way?

Thanks

Batfastad
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Code: Select all

header("Location: main.php");
No doubt you will get an error the first time you use this, when you do, read this viewtopic.php?t=1157&start=0&postdays=0 ... highlight=

Mark
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

<totally unrelated> I missed this question so much. Makes me feel like home. I think I should tell my girlfriend to ask me how to redirect with PHP as a welcome when I get home</totally unrelated>... ;)
User avatar
batfastad
Forum Contributor
Posts: 433
Joined: Tue Mar 30, 2004 4:24 am
Location: London, UK

Post by batfastad »

Superb!!!

Thanks for the excellent help - worked first time as I knew what pitfalls could happen.

Thanks again

Batfastad
Post Reply