1. About.com
  2. Computing & Technology
  3. PHP / MySQL

Discuss in my forum

Finding the HTTP_REFERER

Find out where your viewers are coming from

By , About.com Guide

 <?php 
 echo $HTTP_REFERER; 
 ?> 
The page referrer is found by using the $HTTP_REFERER variable. This is a quick way of looking up where people are navigating to your pages from. Once you know this information you can also filter users based upon it. For example, you only let people who come from one of your referring pages to use your downloads section, etc.

Unfortunately $HTTP_REFERER is not foolproof. Some browsers do not send this information, or can be made to send false information. You should keep this in mind when working with $HTTP_REFERER.

©2012 About.com. All rights reserved. 

A part of The New York Times Company.