now change || to && and see if that does the job -----Original Message----- From: Dan McCullough [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 12:57 PM To: PHP General List Cc: Richard S. Crawford Subject: Re: [PHP] Logic
that didnt work,i started off with if ($type != "add") { that works } else { this works } I have done this before I'm just having a brain cramp. if (($type != "add") || ($type != "edit") || ($type != "delete")) { print $subcat_output; } else { print "<TR><TD BGCOLOR=\"#F7F7F7\" WIDTH=\"20%\"></TD><TD BGCOLOR=\"#F7F7F7\" WIDTH=\"80%\"><FONT FACE=\"Verdana, Arial, Tahoma\" SIZE=\"2\" COLOR=\"#000000\"><a href=".$PHP_SELF."?area=subcategory>Back to List of Subcategories</FONT></TD></tr>"; } --- "Richard S. Crawford" <[EMAIL PROTECTED]> wrote: > You need parentheses around the entire antecedent: > > if (($type !="add") || ($type !="edit") || ($type !="delete")) { //etc > > ^------- Note these parentheses---------------------------^ > > Hope that helps. > > > At 05:28 PM 12/4/2001, Dan McCullough wrote: > > >Question. I am trying to check to see if a certain piece of code should > >be run. Here is an > >example. > >if ($type != "add") || ($type != "edit") || ($type != "delete") {//if this > >or this or this then > >then run this code > >} else { > >then run this > >} > > > >Is this correct, for some reason this isn't working. > > > Sliante, > Richard S. Crawford > > http://www.mossroot.com > AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford > MSN: [EMAIL PROTECTED] > > "It is only with the heart that we see rightly; what is essential is > invisible to the eye." --Antoine de Saint Exupéry > > "Push the button, Max!" > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > ===== dan mccullough -------------------------------------------------------- "Theres no such thing as a problem unless the servers are on fire!" __________________________________________________ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]