Tony-laptops
asked on
Request.ServerVariables("HTTP_URL") How to get full URL string?
Hi All,
I am trying to get the full url of a page, not having any luck in finding the correct code.
I am aware of these 2, but I need to get the full string that’s in the address bar of a page.
Request.ServerVariables("H TTP_URL")
Request.ServerVariables("H TTP_HOST")
Is there any other code that could pull the whole string?
Thank you.
Tony
I am trying to get the full url of a page, not having any luck in finding the correct code.
I am aware of these 2, but I need to get the full string that’s in the address bar of a page.
Request.ServerVariables("H
Request.ServerVariables("H
Is there any other code that could pull the whole string?
Thank you.
Tony
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If in JavaScript,
<script language="JavaScript">
alert(location.href);
</script>
hongjun
<script language="JavaScript">
alert(location.href);
</script>
hongjun
found this
<%
prot = "http"
https = lcase(request.ServerVariables("HTTPS"))
if https <> "off" then prot = "https"
domainname = Request.ServerVariables("SERVER_NAME")
filename = Request.ServerVariables("SCRIPT_NAME")
querystring = Request.ServerVariables("QUERY_STRING")
response.write prot & "://" & domainname & filename & "?" & querystring
%>
<%
Response.Write "http://"
Response.Write Request.ServerVariables("H
Response.Write Request.ServerVariables("U
if Request.ServerVariables("Q
Response.Write "?" & Request.ServerVariables("Q
end if
%>
hongjun