Hello,
could someone help? I have a simple if statement for error handling that basically states:
If a page exists display the page, if it does not display an error. I cannot get this to work. The logic escapes me for some reason and it is doing my head in!
This code works if I remove the "Or" conditions and will redirect 1 page. But if I try to run the condition with or, the page_error.asp page displays regardless.
Any help appreciated!
could someone help? I have a simple if statement for error handling that basically states:
If a page exists display the page, if it does not display an error. I cannot get this to work. The logic escapes me for some reason and it is doing my head in!
Code:
Dim page2, page3, page4, page5, page6, page7, page8, page9, page10, page11, page12, page13, page14, page15, page16, page17
page2 = Request.QueryString("PageID") <> 2
page3 = Request.QueryString("PageID") <> 3
page4 = Request.QueryString("PageID") <> 4
page5 = Request.QueryString("PageID") <> 5
page6 = Request.QueryString("PageID") <> 6
page7 = Request.QueryString("PageID") <> 7
page8 = Request.QueryString("PageID") <> 8
page9 = Request.QueryString("PageID") <> 9
page10 = Request.QueryString("PageID") <> 10
page11 = Request.QueryString("PageID") <> 11
page12 = Request.QueryString("PageID") <> 12
page13 = Request.QueryString("PageID") <> 13
page14 = Request.QueryString("PageID") <> 14
page15 = Request.QueryString("PageID") <> 15
page16 = Request.QueryString("PageID") <> 16
page17 = Request.QueryString("PageID") <> 17
Dim URL
URL = "pagename.asp?" & request.ServerVariables("QUERY_STRING")
If page2 or page3 or page4 or page5 or page6 or page7 or page8 or page9 or page10 or page11 or page12 or page13 or page14 or page15 or page16 or page17 Then
response.redirect("page_error.asp")
Else
response.redirect(URL)
End If
This code works if I remove the "Or" conditions and will redirect 1 page. But if I try to run the condition with or, the page_error.asp page displays regardless.
Any help appreciated!