I don't know why it is doing that, I am using that exact javascript on a site of mine, and it's working perfectly.
However, PHP has a function called HTTP-REFERRER, which displays the url of the page which the person was previously at, you could use that..
|