Solved

If not 5

Posted on 2009-07-09
2
159 Views
Last Modified: 2012-05-07
Can someone please change this code to say if $row_WAATKroi['printer'] does not equal 5 show this html code <li class="t5"><a href="#p7EPMc1_5" id="p7EPMtrg1_5">Running Costs</a></li>

<?php if ($row_WAATKroi['printer'] ==5) { // Begin Show Region ?>
        <li class="t5"><a href="#p7EPMc1_5" id="p7EPMtrg1_5">Running Costs</a></li>
        <?php } // End Show Region ?>

Thanks
0
Comment
Question by:petewinter
2 Comments
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 500 total points
ID: 24814636
When testing if the value IS 5 you use == and when testing if it IS NOT 5, use != like this:
<?php if ($row_WAATKroi['printer'] != 5) { ?>
  <li class="t5"><a href="#p7EPMc1_5" id="p7EPMtrg1_5">Running Costs</a></li>
<?php } ?>

Open in new window

0
 

Author Closing Comment

by:petewinter
ID: 31601646
Many Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question