Why do it this way?
I don't know what your trying to do but would this work?
Set cookies called referer with the value of what you want HTTP_REFERER to have. Then instead of calling HTTP_REFERER whereever, call the cookie. I dunno, mail me at cad67@hotmail.com (as this is an old post) with more info on what exactly you want, maybe I'll be able to help more then.