[Solved] Redirecting URLs?

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
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

[Solved] Redirecting URLs?

Post by mjseaden »

Hi,

How do I automatically redirect a user to another URL if they arrive at a page using PHP or otherwise?

Many thanks

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

Post by patrikG »

Code: Select all

header("location: http:www.myurl.com");
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

as patrick said:

Code: Select all

header("location: http:www.example.com");
this cannot be called before any output to the browser by the way
Post Reply