You could do something simple like
Code:
<script language="Javascript" type="text/javascript">
<!--
var docRef = document.referrer
docRef = encodeURIComponent(docRef) //URI encode the referrer string
dummyPhpImg = new Image
dummyPhpImg.src = '/yourserversidescript.php?REF=' + docRef
//-->
</script>
Basically loads a dummy image object which is actually your php script, don't forget to send a header response as an img file at the of the script, it can be an empty 1x1 pixel image, doesn't matter as you're not going to display it. BTW you can add more parameters to the query string such as screen size, client time, etc.