in reply to referal url

You can use $ENV{'HTTP_REFERER'}, although it's easily forge-able.