Forum Moderators: open
I got it to work for the most part. The problem I have is there is some pages that have the Ampersand symbol or the & in it.
The ones that do have that sign when I request to pull the text for that page it doesn't work and I know its because of the & symbol.
Here is my example:
case "test&test4"
response.write "skdkdksdkskdksd"
so my question is how do i make it work?
I'm assuming Classic ASP? [looks like it even though .net forum?]
'Set the Name/Location of the page
'Example will return "/index.asp?a=1&b=1"
PageName = Request.ServerVariables("URL")
If Request.ServerVariables("Query_String") <> "" Then
PageName = PageName & "?" & Request.ServerVariables("Query_String")
End If
Select CASE PageName
CASE "/index.asp?a=1"
Response.WRite "Foo ... " & PageName
CASE "/other.asp?a=2&b=3"
Response.Write "Foo2 ... " & PageName
CASE ELSE
Response.Write "Other / Unknown"
End Select
Of course this is a bad idea... Depending on your server setup anyone can modify a QueryString and therefore your test would fail.
You could test for specific querystrings (very common) or test for the individual name of the page (in which case "URL" server variable works handily)
HTH
vfoo