for example...
if(isset($_GET['utm_blah'])) { $referrer = $_GET['utm_blah'; }
else { $referrer = $_SERVER['HTTP_REFERER']; }
looking to parse referrer sent by google adwords, or twitter, or email, ... etc开发者_StackOverflow. thanks!
A little snippet
if(isset($_SERVER['HTTP_REFERER'])) { $in['ref'] = $_SERVER['HTTP_REFERER']; } //... if(isset($in['ref'])) { $found=false; /* referrer on same domain ? */ if(isset($in['domain'])) { $refdomain=eregi_replace("^www.","",parse_url($in['ref'],PHP_URL_HOST)); if($in['domain']==$refdomain) { $found=true; } unset($refdomain); } /* check referrer ignore list */ if($found==false && is_file('refferer.ignore.txt') && filesize('refferer.ignore.txt')>0) { $ignorelist=explode("\n",file_get_contents('refferer.ignore.txt')); $maxi=count($ignorelist); if($maxi>0) { $i=0; while(false===$found && $i
精彩评论