12 Jul
2010
12 Jul
'10
2:17 p.m.
Chris McCreery wrote:
Right now I have this:
<?php if (arg(1) != '39'): ?> <div> Content </div> <?php endif; ?>
This works just fine but when i try to add in a second arg(1) and OR statement it doesn't work. Any ideas?
I made this mistake often when I first started programming. Use AND and not OR when using !=. Or you could use the alternative method as show below. <?php if (arg(1) != '39' && arg(1) != '49'): ?> <div> Content </div> <?php endif; ?> ALTERNATIVE: <?php if (!(arg(1) == '39' || arg(1) == '49')): ?> <div> Content </div> <?php endif; ?> -- Earnie -- http://progw.com -- http://www.for-my-kids.com