Requesting URL

A

Adrian Forbes - MVP

if strcomp(Request.ServerVariables ("HTTPS"), "ON", 1) = 0
then
sURL = "https://"
else
sURL = "http://"
end if
sURL = sURL & Request.ServerVariables ("SERVER_NAME")
sURL = sURL & Request.ServerVariables ("SCRIPT_NAME")
if len(trim(Request.QueryString)) > 0 then
sURL = sURL & "?" & Request.QueryString
end if

Response.Write sURL
 
R

Ray at

Oops. This answer will not be enough to get the result you want.

I think this will work.
<%
sScript = Request.ServerVariables("SCRIPT_NAME")
aScript = Split(sScript, "/")
sScript = aScript(UBound(aScript))

Response.write sScript
%>

Ray at work
 
D

David de Jong

Thanks, this seems to work, I have to say that I didn;t think of this
solution yet,
David
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top