moved HTTP_REFERER from php to js