how to redirect every user that has referer

iglow's Avatar, Join Date: Dec 2009
Go4Expert Member
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
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
How is your referrer id coming on the page.

If its any GET Variable check the value and redirect.
iglow's Avatar, Join Date: Dec 2009
Go4Expert Member
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.
Deadly Ghos7's Avatar, Join Date: Dec 2009
Contributor
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
iglow's Avatar, Join Date: Dec 2009
Go4Expert Member
exactly what i was looking for - thanx!
Deadly Ghos7's Avatar, Join Date: Dec 2009
Contributor
my pleasure, bro.