soup4you2
August 28th, 2003, 10:46
Ok PHP Guru's i got a question for you...

anybody know of a way and this is an example that if somebody were to click a link off google to a website that the php script would determine that the visitor came from google and display a image saying "Welcome google user"

this method is known as a googletap

however i cant think of how this would be done.. but i know it is possible

v902
August 28th, 2003, 18:15
Look at the refer, if the base URL is google.com then you can display the image

[code:1:9c329e9d09]if(blah blah blah)
?> <img src="google.com><?
[/code:1:9c329e9d09]

Yes refer can be spoofed but if they can spoof it they don't need a hello google user image :D

EDIT This should work:

[code:1:9c329e9d09]
if(eregi("google.com", $_SERVER['HTTP_REFERER'])
echo "<img src='google.jpg'>"
[/code:1:9c329e9d09]

If they spoof blah.com/google.com it will work but I'll post a fix when I get my PHP juices flowing...

soup4you2
August 28th, 2003, 18:57
nice thanks.....

v902
August 28th, 2003, 19:24
[code:1:052c766781]
$baseURL= explode('/', $_SERVER['HTTP_REFERER'])
if(eregi("google.com", $baseURL[0])
echo "<img src='google.jpg'>"
[/code:1:052c766781]

Does that work? I'm rusty on PHP... I'll also try to find a more effecient way of doin this...