Set it? Whenever a user clicks on a link on your page the HTTP_REFERER gets set automatically by the browser.
If you are trying to access a page from within a php script (using php as the browser) then you need to construct the HTTP header to send to the server you are contacting. Look at www.w3c.org for information on the correct formatting of an HTTP header.