Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
ASP Code question
Name: Bungle Date: June 1, 2009 at 09:10:53 Pacific OS: XP CPU/Ram: Unknown Subcategory: General
Comment:
Hi guys - does anyone know the code to "Read" what the current URL is in the address bar to put into an IF THEN statement. I need to show a different script depending on what page the user is currently on.
Name: rolica Date: July 9, 2009 at 19:01:25 Pacific
+1
Reply:
Try this:
<% 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 %>
<% If strURL="WhateverPageYouWant" then 'run this script End If %>
Response Number 2
Name: Bungle Date: September 30, 2009 at 11:01:34 Pacific
+1
Reply:
Sorry - I have been away for a long time, thank you for your help! :o)
Summary: hi all, i need a defination of the following piece of ASP code: <%if (objRs.BOF) then%> Sorry, no information availble <%Else%> thanx in advance Thank you Sayeed Ahmed ...
Summary: Hi all, I have a simple ASP.NET question here. I wanna to create a button which can pop-up a 'date pop-up box' for user to select her preference date. For example, just like the date (bottom right-co...
Summary: Hi and thanks for reading. I have some asp code here in a login script which validates a user against our Active Directory account info. It works great as long as I enter a correct username and passw...