Vista Online by Friends Of Vista, Inc. - A Texas Nonprofit Corporation | Informative Articles For Your Life | Click Here To Return To Index Page Of Site

How To Find The Current URL With ASP

   By: Sven Vdhrison

The full URL to a page comes in three parts: The domain name, the path to the file then the filename, and the QueryString. For example, take the URL http://www.example.com/example/page.asp?name=Bob. The three parts of this are:

The domain name: www.example.com
The path to the page: /example/page.asp
The QueryString: name=Bob

So how do you find it all out with your own scripts? Well the following code should do it:
<%@language="VBScript"%>
<%
Dim strDomain, strPath, strQueryString, strURL
' find out the domain:
strDomain = Request.ServerVariables("HTTP_HOST")
' find out the path to the current file:
strPath = Request.ServerVariables("URL")
' find out the QueryString:
strQueryString = Request.ServerVariables("QUERY_STRING")
' put it all together:
strURL = "http://" & strDomain & strPath & "?" & strQueryString
Response.Write "The current URL is: " & strURL
%>


Article Source: http://www.friendsofvista.org/articles/article5041.html





Related Articles

Recent Studies Show That 9 Out Of 10 Pcs Are Infected With S - Jason Frovich
The PR Rainmaker Always Has A Plan B - Rusty Cawley
Big Business Web Design Disasters - Joel Walsh
The Great Underutilized Computer - Tony Papajohn
Easy Computer Tips - Benjamin Hargis
Boost Your B To B Marketing Copy: 3 Major Copywriting Blunde - Jennifer McCay
Computer Maintenance And Improving PC Performance - Shawn Shellenbarger
Computers And Web Cams Are Taking Communication To Levels On - M6.Net
Tidy Up ITunes MP3 Collection - Everton Blair
Pruning Your Site For Greater Results; 3 Sure Fire Design Ti - Christine Graham
   

 
Website Design and Logo Design by InfoServe Media, LLC

Copyright © 2012 Friends of Vista, Inc. TM - A Texas Nonprofit Corporation
Privacy Statement | Contact Us