Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP_REFERER doesn't have any value

Status
Not open for further replies.

920506

Programmer
Jun 13, 2003
201
US
Hi, all,

I have a form test.asp with certain fields will show depend on what page it comes from.
i.e.
I set up redirect to
test.asp, in test.asp, I wrote:
sReferer = Request.ServerVariables("HTTP_REFERER")
if sReferer=" " then
displayfields
but somehow is sReferer is empty.
what should I do? I just stuck.
Thank you.
Betty
 
try this:
Code:
if instr(Request.ServerVariables("HTTP_REFERER"),"[URL unfurl="true"]www.mydomain.com/somedirectory")[/URL] > 0  then
'do something
else
'do someother thing
end if

-DNG
 
Hi, Chris,
I guess it's all blocked.
I already set up a specific link on a page already,
my test.asp still doesn't any charaters from

Request.ServerVariables("HTTP_REFERER")

It just empty?
any other way go around?

Betty
 
Chris,
I tested it, and I did see the referer variable.
So I did in my program in the same way. When I put link on the same domain as the program, it seems working fine. My problem is: the link is on different dommain(I didn't specify clearly) and the program is running on another domain.

That is: link on the program test.asp is running on When the test.asp tried to access Request.ServerVariables("HTTP_REFERER"), it's just empty.
I am justing wondering how webtrend monitoring referral page if cross domain referer page cannot be obtained.

Thank you.
Betty
 
Have you tried writing out all the servervariables to see if any are working?

Code:
for each vari in request.servervariables
    with response
         .write vari
         .write " = "
         .write request.servervariables(vari)
         .write "<br>"
    end with
next

webtrends uses javascript to track page views/referers and if the referer field is blocked it doesn't.


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Yes, it does show many server variables, but not http_referer.

Thanks
Betty
 
HTTP_REFERER is a value provided by the web browser to the server purely as a courtesy. The HTTP protocol does not require the browser to provide a correct value for HTTP_REFERER or any value at all.

No web application should be designed that relies on the accuracy of this value… treat it as merely an informational curiosity for your log files.
 
Hi all,
Thanks for all your guys input. I gave up using HTTP_REFERER. I just added a coulpe fields with values to indicate where does the page come from.
It worked out.
I believe Sheco's comment is right. I should not depend on this variable in my program.
Betty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top