March 22nd, 2003, 07:33 PM
how do i display the current URL
i'd like to know how to display the current URL on the web page as a footer. This seems to be a fairly simple task, but everything i've found on the internet either doesn't work for some reason, or is asp.net specific.
Any suggestions would be great.
March 22nd, 2003, 08:19 PM
You could combine the SERVER_NAME and URL
<% Response.write( "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") )%>
You could check the PORT variable to find out if it is http or https
This link lists all the server variables
There is another way using server map path or something similar , but I cannot remember the exact code for it.
Hope this is helpful.
March 23rd, 2003, 07:56 PM
March 23rd, 2003, 09:23 PM
One of the Request serve variables is QUERY_STRING
so it would be something like
Response.write( "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") ) & "?" & Request.ServerVariables("QUERY_STRING") ) %>
Read more about those Request.ServerVariables there is alot of info about them .. a simple search on google for "Request.ServerVariables" will return a lot of hits ...
I hope this is of any help.
March 23rd, 2003, 09:32 PM
Thanks very much
thats a great help