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.
Making PHP direct someone to a diff site
Moderator: General Moderators
Read this:
http://www.php.net/manual/en/function.header.php
Send a raw header to the browser and it'll redirect them transparently.
http://www.php.net/manual/en/function.header.php
Send a raw header to the browser and it'll redirect them transparently.
- puckeye
- Forum Contributor
- Posts: 105
- Joined: Fri Dec 06, 2002 7:26 pm
- Location: Joliette, QC, CA
- Contact:
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:
You change the 0 for any amount of seconds you want and THE_URL for the URL you want to point to.
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">