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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[?] Getting Refering Address [?]

Status
Not open for further replies.

baden

Programmer
Feb 6, 2002
125
US
I'm sure I've got the concept behind Request.ServerVariables("HTTP_REFERER"), but I need some help.

fillform.html: located at formprocessor.asp located at
User fills out the form located at fillform.html, where the form action is "
Doing
Code:
callingURL = Request.ServerVariables("HTTP_REFERER")
Response.write "<br>caller: " & callingURL & "<br>"
at formprocessor.asp returns nothing.

Using
Code:
For Each obj In Request.ServerVariables
  Response.write obj & ": " & Request.ServerVariables(obj) & "<br>"
Next

I see:
Code:
LOCAL_ADDR: 69.44.152.113
REMOTE_ADDR: 24.66.94.141
REMOTE_HOST: 24.66.94.141

There is no HTTP_REFERER.

I want to authenticate the request from the referrer against a database value, so requests are only accepted from that particular server or file (

Help.


Thanks.
 
Most of the stuff that is normally found in an HTTP header is optional. If the browser decides not to send it then you just wont get it. Some people configure their browsers to do this because of "privacy" concerns... other people install software that "protects their privacy" by removing all but the required HTTP headers... some people are behind proxy servers that do this dastardly deed.
 
you can try this:
Code:
If instr(Request.ServerVariables("HTTP_REFERER"),"24.66.94"
) Then

'request can be accepted
else
'request denied
end if

-DNG
 
Thanks DotNetGnat, BUT....

See the lines above:
Code:
callingURL = Request.ServerVariables("HTTP_REFERER")
Response.write "<br>caller: " & callingURL & "<br>"

callingURL is null... meaning Request.ServerVariables("HTTP_REFERER") is null.

When doing
Code:
For Each obj In Request.ServerVariables
  Response.write obj & ": " & Request.ServerVariables(obj) & "<br>"
Next

There is no HTTP_REFERER in the list! Why?

 
I would suggest that first off you try from a different machine as it looks to be something on the one you are using is blocking headers.
The one thing that cannot be blocked during a HTTP response are IPs which is why you see those returned.


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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top