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 Quote Link to comment 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']?> Quote Link to comment 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] Quote Link to comment 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]. Quote Link to comment Share on other sites More sharing options...
xsist10 Posted October 16, 2006 Share Posted October 16, 2006 Dreamweaver + PHP = >:( Quote Link to comment 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. Quote Link to comment 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. :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.