Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2002
    Location
    NW Iowa
    Posts
    185
    Thanks
    9
    Thanked 0 Times in 0 Posts

    If request.Querystring("var1") = "" or request.querystring("var2") = ""

    I have a page where I'm displaying certain things depending on the querystring.

    If I only use one request.querystring, then it works, but if I add an OR statement to show if either one of 2 cases is applicable, then it doesn't work.

    http://portal.thinix.com/attractions...=4&contact=yes
    OR
    http://portal.thinix.com/attractions...ctcomplete=yes
    *If contact = anything, then the rating system should not display
    *If contactcomplete = anything, then the rating system should not display

    My code is here:
    WORKS to not display the "rating system":
    Code:
    <% If request.QueryString("contact") = "" Then %>
    <div style="padding-top:50px">Rate <%=(rs_attraction.Fields.Item("f_name").Value)%>:</div>	
    <% END IF %>
    DOES NOT WORK
    Displays the rating system:
    Code:
    <% If request.QueryString("contact") = "" or request.QueryString("contactcomplete") = "" Then %>
    <div style="padding-top:50px">Rate <%=(rs_attraction.Fields.Item("f_name").Value)%>:</div>	
    <% END IF %>
    Surely it is possible to accomplish this task. I just need the rating system to NOT show if the querystring contains either "contact" or "contactcomplete".

    Thanks,
    Matt

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    *If contact = anything, then the rating system should not display
    *If contactcomplete = anything, then the rating system should not display
    If they're both blank, display rating. Else do not. That's AND, not OR.

    Code:
    <% If request.QueryString("contact") = "" AND request.QueryString("contactcomplete") = "" Then %>
    <div style="padding-top:50px">Rate <%=(rs_attraction.Fields.Item("f_name").Value)%>:</div>	
    <% END IF %>

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    (doesn't want to let me edit for some reason)

    You could do it as an OR a little backwards by testing for not blank instead of blank, but that would also reverse the display into a do not display, which is a bit opposite of what you're going for here.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •