PDA

Click to See Complete Forum and Search --> : What am I doing wrong??


compuGEEK
Aug 3rd, 2000, 02:06 PM
Hi,

I'm trying to find the referring URL.

For example:

If you came from www.someplace.com,
I could load a specific page for the user.

I've tried using
request.ServerVariables("HTTP_REFERER")
but it's not working. It's showing up as blank.

I've also tried appending ?from=CompanyWebsite
and using request.querystring to load the page that way
and I cannot get it to work.

I'm using a webclass to do this. I'm putting my code
in the Private Sub WebClass_Start() event.

Are there other ways of finding the referring URL besides
the two methods I tried?

Thank you in advance!

compuGEEK
Aug 3rd, 2000, 04:41 PM
I finally figured it out!!!

HTTP_REFERER does not work in a webclass. I found that out
the hard way.

What I was trying to do is pass a parameter in the
query string. This is how I had set the parameter:


<a href = "http://www.MyWebClass.com?From=XYZ">Click Here</a>



The problem with that, is that I could not pick up the
query string variable from my webclass. Because in order
to do that the ASP page has to be referenced. When you clicked that link, the URL on my webclass site looked like
this:


http://www.MyWebclass.com/?from=XYZ


When I tried using:

strReferrer = request.queryString("From")

strReferrer was showing up blank because the wc.asp was not
being referenced.

What I ended up doing was creating the parameter like this
instead:


<a href = "http://www.MyWebClass.com/wc.asp?From=XYZ">Click Here</a>


Then I was able to pick up the query string variable just
fine.

Anyway, I hope this helps someone in the future....
I am so happy now, I could SCREAM!!!!