The referring page, when a browser sends it, can be read through Request.ServerVariables using HTTP_REFERER.
The referrer is optional and not authoritative. It may be absent because of direct navigation, browser/privacy settings, HTTPS/referrer policy, or intermediary behavior. Do not use it as a security or authorization control.
<%= Request.ServerVariables("HTTP_REFERER")%>network.http.sendRefererHeader
The above header is to be made to 2 if referrer is to be send through header.
Dim referrer
referrer = Request.ServerVariables("HTTP_REFERER")
If Len(referrer) = 0 Then
Response.Write "No referrer was supplied"
Else
Response.Write Server.HTMLEncode(referrer)
End IfDo not assume the header exists. Never rely on the referring URL for login or access control.
Direct visits and privacy settings can omit it, and the value is not proof of where a request came from. It is useful for optional analytics, not security decisions.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.
| majed | 01-11-2014 |
| what about users that visit our site by scripts from another site <script locate='www.mysite'> how can we find address of site that visitors are comming | |