Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.
Thanks :)
I only pretend to know what I'm talking about.

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 %>

Sorry - I have been away for a long time, thank you for your help! :o)
I only pretend to know what I'm talking about.

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |