how can I get the url?

M

middletree

How can I grab the URL and place it into an ASP/VBscript variable? I'm
having a hard finding it in the documentation. Probably don't know the
proper term to use.

But if I am brought to a page, and it happens to to have an address of (this
is for an Intranet app):

http://intranet/displaydata.asp?custid=1&zip=12345&haircolor=brown

then I'd like that whole thing. Not just the part before the ? mark, but
each and every character.

How do I do that?
 
K

Ken Jenkins

Thispage = Request.ServerVariables("script_name") & "?" &
Request.Querystring & Request.Form
 
S

Slim

Ken Jenkins said:
Thispage = Request.ServerVariables("script_name") & "?" &
Request.Querystring & Request.Form

try this


dim thisPage
thisPage= "http://"& Request.ServerVariables("SERVER_NAME") &
Request.ServerVariables("URL")

if Request.Querystring <> "" OR Request.Form <> "" then
thisPage = thisPage & "?" & Request.Querystring & Request.Form
end if

Response.Write thisPage
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top