jeffreytp
asked on
HTTP_REFERER
I want to log the Request.ServerVariables("H TTP_REFERE R") when the 1st time a user enters any page on my root domain. They could enter the site from say a search engine and land on page 2 of my site. Then they may go to page 3 from there. When the user land on page 2 I want to log the other dmain address they came from. How do I do this?
oops, forgot one line:
include file:
<%
if not session("gotrefer") = "true" then
'log http_referer
session("gotrefer") = "true"
end if
%>
all other files:
<!--#include file="aboveinclude.asp"-->
<%
'other asp code...
include file:
<%
if not session("gotrefer") = "true" then
'log http_referer
session("gotrefer") = "true"
end if
%>
all other files:
<!--#include file="aboveinclude.asp"-->
<%
'other asp code...
ASKER
Thank you for your input WMIF I played around with the asp code you provided and this is the code that does what I intended it to do, maybe you didn't quite understand what I was saying:
if not session("referer") > "" then
'log http_referer
session("referer") = Request.ServerVariables("H TTP_REFERE R")
end if
if not session("referer") > "" then
'log http_referer
session("referer") = Request.ServerVariables("H
end if
that will definately store the referer information into a session variable, but i figured that you wanted to store this information into a database or file of somesort. that is what i intended to replace the comment "log http_referer". sorry i did not explain that better. do you only want to store this into a session variable?
ASKER
for now, and then I can take the session and place that into a DB.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just a heads up "Request.ServerVariables(" HTTP_REFER ER")" is not reliable as most antivirus packages like NORTON block it from showing up
include file:
<%
if not session("gotrefer") = "true" then
'log http_referer
end if
%>
all other files:
<!--#include file="aboveinclude.asp"-->
<%
'other asp code...