Is it possible to access the referring URL with PHP?
$_SERVER['HTTP_REFERER']
That should do the trick