could some one tell me the php if else statement to display different images for different subcategories. I have done the css part however not sure about the php coding.................................................................................................................................................................................................Let say for the category link "products.php?mcatid=5&scatid=1"i want to display the image1 and For the category link "products.php?mcatid=5&scatid=2"i want to display the image2 and so on.......................................................................................................................................................................................if category link (products.php?mcatid=5&scatid=1)echo 'class="Header1"';else if if category link (products.php?mcatid=5&scatid=2)echo 'class="Header2"';else echo 'class="Header-jpeg"';
I suggest you do it like this: <?php if($_GET['scatid']==1){ $class = "Header1"; } else if($_GET['scatid']==2){ $class = "Header2"; } ?> <div class="<?php echo $class; ?>"></div> in my opinion that's cleaner.