Page 1 of 1
Making PHP direct someone to a diff site
Posted: Wed Jan 29, 2003 3:35 pm
by nigma
I want to make it so that when a user tries to enter a specified part of my site(maybe links or something) they are re-directed to
http://www.google.com(or something else). There isn't really a point to doing this, except ofcourse, to further my knoledge(or lack of it) in PHP. Anyone help me with this?
Thanks for all help provided.
Posted: Wed Jan 29, 2003 3:47 pm
by bznutz
Read this:
http://www.php.net/manual/en/function.header.php
Send a raw header to the browser and it'll redirect them transparently.
Posted: Wed Jan 29, 2003 3:50 pm
by puckeye
Hi,
2 ways to do that, ASAIK to redirect a visitor to another page.
either use the header("Location: URL"); function
http://www.php.net/manual/en/function.header.php NOTE that you have to make sure that there's nothing sent to the user's browser before you use the header() function read more here:
viewtopic.php?t=1157
The other way is to use a HTML Meta tag:
Code: Select all
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=THE_URL">
You change the 0 for any amount of seconds you want and THE_URL for the URL you want to point to.