# Document.referrer

**URL:** <https://forum.kirupa.com/t/document-referrer/320793>\
**Category:** Uncategorized\
**Created:** [April 1, 2011, 2:52pm UTC](https://forum.kirupa.com/t/document-referrer/320793 "2011-04-01T14:52:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewlong](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@andrewlong](https://forum.kirupa.com/u/andrewlong)\
**Post date:** [April 1, 2011, 2:52pm UTC](https://forum.kirupa.com/t/document-referrer/320793/1 "2011-04-01T14:52:40Z")

</div>

I have a newb question regarding the document.referrer property (or the PHP equivalent HTTP\_REFERER).

I am using a site ([mturk.com](http://mturk.com)) that posts templated HTML. When a person sees this HTML page, I need their ID number, which is normally found in the URL as a query variable. I used to be able to put scripting in the HTML template and grab the URL. I can no longer do this, and thought I would put a link in the HTML template taking them somewhere else where I can grab that URL using document.referrer. However, the property is always blank (it works if I link to the page from somewhere other than [mturk.com](http://mturk.com) though).

Under what conditions does document.referrer not work? If the referring link is within a frame? Can the referring page turn this functionality off?
