Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   how to redirect every user that has referer (http://www.go4expert.com/forums/redirect-user-referer-t20484/)

iglow 23Dec2009 16:58

how to redirect every user that has referer
 
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 23Dec2009 18:48

Re: how to redirect every user that has referer
 
How is your referrer id coming on the page.

If its any GET Variable check the value and redirect.

iglow 23Dec2009 19:01

Re: how to redirect every user that has referer
 
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 23Dec2009 19:42

Re: how to redirect every user that has referer
 
Quote:

Originally Posted by iglow (Post 62125)
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 23Dec2009 21:21

Re: how to redirect every user that has referer
 
exactly what i was looking for - thanx!

Deadly Ghos7 23Dec2009 21:41

Re: how to redirect every user that has referer
 
my pleasure, bro.


All times are GMT +5.5. The time now is 23:04.