jeboy Posted October 16, 2006 Share Posted October 16, 2006 I write a code that will show up the referers url, I used $HTTP_REFERER, $_SERVER['HTTP_REFERRER'] but it doesnt work. Here's my code:[color=green][font=Verdana][b]$ref = @$_SERVER["REFERER"];// try to catch the referrerif (empty($ref) && !empty($HTTP_REFERER)){ $ref = $HTTP_REFERER;}echo 'Your referer to this page is ';echo $ref;[/b][/font][/color]I'd like to use that method for me to track the page in which the visitor used to click the link and the visitor will be redirected back to that page.Hope you could help me, thanks Link to comment https://forums.phpfreaks.com/topic/24070-about-php-referrer/ Share on other sites More sharing options...
xsist10 Posted October 16, 2006 Share Posted October 16, 2006 All you need to know about tracking visitors:[url=http://www.phparchives.za.org/articles.php?file=13]http://www.phparchives.za.org/articles.php?file=13[/url]The referer variable is:<?php$_SERVER['HTTP_REFERER']?> Link to comment https://forums.phpfreaks.com/topic/24070-about-php-referrer/#findComment-109384 Share on other sites More sharing options...
redarrow Posted October 16, 2006 Share Posted October 16, 2006 [code]<?php$host=apache_request_headers();echo "\$host['Referer'] = {$host['Referer']}\n";echo "\$_SERVER['HTTP_REFERER'] = {$_SERVER['HTTP_REFERER']}\n";?>[/code] Link to comment https://forums.phpfreaks.com/topic/24070-about-php-referrer/#findComment-109386 Share on other sites More sharing options...
jeboy Posted October 16, 2006 Author Share Posted October 16, 2006 Thanks! I use dreamweaver in writing php scripts, when I type the code $_SERVER['HTTP_REFERER'], it auto completes to [color=red][b]HTTP_REFERRER[/b][/color] instead of [color=green][b]HTTP_REFERER[/b][/color]. Link to comment https://forums.phpfreaks.com/topic/24070-about-php-referrer/#findComment-109387 Share on other sites More sharing options...
xsist10 Posted October 16, 2006 Share Posted October 16, 2006 Dreamweaver + PHP = >:( Link to comment https://forums.phpfreaks.com/topic/24070-about-php-referrer/#findComment-109390 Share on other sites More sharing options...
redarrow Posted October 16, 2006 Share Posted October 16, 2006 That why most php programmers use notepad lol.All the best redarrow. Link to comment https://forums.phpfreaks.com/topic/24070-about-php-referrer/#findComment-109391 Share on other sites More sharing options...
Jenk Posted October 16, 2006 Share Posted October 16, 2006 Just to note that referals are not reliable - they depend on the previous host using transfers and the client to actually submit the data, which doesn't always happen. :) Link to comment https://forums.phpfreaks.com/topic/24070-about-php-referrer/#findComment-109400 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.