You're right, you have to transmit the info to your PHP script. You can do this thanks to the javascript "referrer" (2 r's) property :
<SCRIPT>
var url="http://www.mysite.com/writelog.php";
document.write("<SCRIPT SRC='" + url + "?REF="+escape(document.referrer) + "'>");
document.write("//--></" + "SCRIPT>");
</SCRIPT>
(the last string is split to avoid a javascript parse error).
Sympa de voir un Frenchie de temps en temps ;-)