An exception was thrown in my application, but the HTTP_REFERER was null, which seems strange in this case. I’m wondering if you could answer a quick question:
So I’ve got this form:
<!-- mysite.com/index.html -->
<form action="http://mysite.com/somewhere/else">
<input type="submit" />
</form>
When someone submits the form, I am expecting that the $_SERVER['HTTP_REFERER'] will be set to /index.html. Is that true?
$_SERVER['HTTP_REFERER']is the value of the optional HTTP Referer header. This header is set by the browser.The browser can opt to not set it or to lie about it, such as Firefox’s RefControl addon does. Thus, you cannot rely on it to be present, or even accurate.
If a browser does give it, it will most likely not be
/index.html, but ratherhttp://www.mysite.com/index.html