Getting the page referrer from header information in ASP

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.



By using referrer once we can know how many visitors are coming from google or from other search engines and what are the keywords they are using.

In PHP we can get the referrer URL and details are here.

In ASP we will collect the http header information to get the referrer. Note that if some one has typed the page name in address bar and reached the page then referrer information will not be there. Referrer information along with some other data are used for logging or tracking the visitors.

We will use http header name HTTP_REFERER to get the URL ( site address ) of the referrer . Here is the code.
<%= Request.ServerVariables("HTTP_REFERER")%>
Some browsers have settings to manage the header information. This way one of the important header referrer header information can be blocked. For Firefox browser at the address bar type about:config and browse through the settings, select and change the values if you want. ( be warned to change the settings , and read all the guidelines and read in details from Mozilla and other resources )
network.http.sendRefererHeader
The above header is to be made to 2 if referrer is to be send through header.
IP address Cookies
ASP Home



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



✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer