how to redirect every user that has referer

Go4Expert Member
23Dec2009,16:58   #1
iglow's Avatar
okay so i want to redirect with php all users that have referer using php. the ones that have no referer dont get redirected.
ive lost the code for it, and it was preety small and neat
Go4Expert Founder
23Dec2009,18:48   #2
shabbir's Avatar
How is your referrer id coming on the page.

If its any GET Variable check the value and redirect.
Go4Expert Member
23Dec2009,19:01   #3
iglow's Avatar
hi again shabbir
im just looking for working code, i dont care if it will be with get or anything else. lets say i have wordpress blog and want to redirect everybody who has referer to 2nd page.
Contributor
23Dec2009,19:42   #4
Deadly Ghos7's Avatar
Quote:
Originally Posted by iglow View Post
hi again shabbir
im just looking for working code, i dont care if it will be with get or anything else. lets say i have wordpress blog and want to redirect everybody who has referer to 2nd page.
I always look for people who want to learn what they are using anyway strictly writing, below is the code for what you are saying:
PHP Code:
<?php
$referer 
$_SERVER['HTTP_REFERER'];
if (isset(
$referer))
{
    
header("location:placeyouwant");
}
?>
Be sure to drop the reply if you want something different.
Regards
Deadly Ghos7
iglow like this
Go4Expert Member
23Dec2009,21:21   #5
iglow's Avatar
exactly what i was looking for - thanx!
Contributor
23Dec2009,21:41   #6
Deadly Ghos7's Avatar
my pleasure, bro.