I am working on a website statistics engine for a class. The idea being that you can simply embed a little code in your web page which will call the stats website on every p
$_SERVER['HTTP_REFERER'] will get you the referring page.
$_SERVER['HTTP_REFERER']