Home | Advertising Info59 USERS CURRENTLY ONLINE   
   Site Search Contact Us Thursday, September 18, 2014  
 
 







DISCUSSION ARCHIVES
DISCUSSION ARCHIVES 2
DISCUSSION ARCHIVES 3
BLOG

 
Try a free httpZip trial now and compress for less!


We didn't realize
the site was so popular.

Other Stuff
 
 


Get the current page URL




There are times in your scripts when you are going to want to get the current page URL that is shown the browser URL window.
For example maybe a page URL has Querystring info appended to it and you need to send an email off to someone with that same exact URL and Querystring information. There are plenty of other reasons as well.

Here is some code to do it.


Lets say the current page is simply "http://www.mysite,com/view_user.asp"

This is all you need to get you the current page URL
<%
Thispage ="http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL")
%>


Now, if your page has Querystring info and variables you want as well.
Like so "http://www.mysite,com/view_user.asp?ID=1&Name=Fred"

you would use code like this.

<%
Thispage ="http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") & "?" & Request.Querystring
%>



If your page had Form info that might have been posted to it you would use code like this.

<%
Thispage = "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") & "?" & Request.Form
%>


If your page had both Querystring and Form info you could try code like this.

<%
Thispage = "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") & "?" & Request.Querystring & Request.Form
%>

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2014 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com