Forum Moderators: open

Message Too Old, No Replies

How do I get the address that is in the users browser?

         

BRCMarketing

8:05 pm on Aug 22, 2006 (gmt 0)

10+ Year Member



www.mysite.com/default.asp

vs.

www.mysite.com/ (assuming default.asp is the default document)

How can I know what the user has in their address bar?

I tried Request.ServerVariables("URL") but that returns /default.asp either way.

aspdaddy

9:20 pm on Aug 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try these too - HTTP_HOST, SCRIPT_NAME, PATH_INFO
You might need to join a couple together to get the actual url.

BRCMarketing

12:37 pm on Aug 23, 2006 (gmt 0)

10+ Year Member



Unfortunately none of those work either...

anyone have any other ideas?

carlb007

1:38 pm on Aug 23, 2006 (gmt 0)

10+ Year Member



you could maybe use a redirect the first time the page is loaded that then sends it back to the same place. Then use: HTTP_REFERER to check the page that it came from?

Im not sure if it picks the variable up on a redirect tho, or whether it requires a physical link or click by a user. Something to try though...

Easy_Coder

2:46 pm on Aug 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"http://" + Request.ServerVariables("server_name") + Request.ServerVariables("path_info")

bsterz

1:52 am on Aug 24, 2006 (gmt 0)

10+ Year Member



I see your problem..

When requests are made to the default directory, the path_info shows the name of your default document (in this case default.asp) rather than "hostname/".

I'll install IIS and play with it.

Bill

mrMister

12:47 pm on Sep 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Override the default rewriting mechanism in IIS using something like ISAPI_Rewrite (in which case, you'll get an X header telling you where the original request came from)

Otherwise use Javascript to retrieve the contents on the client's browser and have it send the data to your server using AJAX.

vite_rts

1:11 pm on Sep 1, 2006 (gmt 0)

10+ Year Member



I had a similar issue

see

[webmasterworld.com...]