Hi, I'm doing some tracking with one of my websites. I'm currently passing URL variables to the next page by capturing it in a hidden field in a form. Eg <input name="var" type="hidden" value=<? echo $_GET['var'] ?>> So if the user enters using for instance http://www.mysite.com/?var=value "value" will be captured and passed on to the next page where getQueryStringVariable('var') will capture and store it. However, there are some people directly entering the site and from other sites be it google, yahoo etc. which are not captured because there's nothing in the variable. What I need is to find out what the referring site is and pass it to the variable above.
you can do by this if some from google the var value == empty if ($_REQUEST['var'] == "") { $ref = $_SERVER['HTTP_REFERER']; if ($ref=="") { $ref = "externalsite"; } header('Location: http://www. example. com/?var=$ref'); } PHP: put this code at your sites home page! so i will trace its referal if referal == empty then it will asign var val = from esternal site and lands on page with http://www. yoursite .com/var=externalsite I hope this will help you!