...

View Full Version : If request.Querystring("var1") = "" or request.querystring("var2") = ""



mattboy_slim
12-29-2006, 03:25 PM
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.asp?ID=4&contact=yes
OR
http://portal.thinix.com/attractions.asp?ID=4&contactcomplete=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":


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


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

nikkiH
12-29-2006, 05:19 PM
*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.


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

nikkiH
12-29-2006, 05:23 PM
(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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum