Hi, I was wondering if someone could help me with something I am working on. I am trying to have a certain banner show only on a certain search results page. For instance, if the url is mydomain.com/viewtopic.php?f=37 is viewed i would want a certain banner to show just for that specific URL. How would my IF statement have to be in my viewtopic.php page? Thanks!
If would do it like this: <?php $image = ''; switch((int)$_GET['f']) { case 37: $image = 'this_image.jpg'; break; default: $image = 'that_image.jpg'; } ?> PHP: Further down you would echo out the image. echo '<img src="images/'.$image.'">'; PHP:
Check the scriptname if ($_SERVER['SCRIPT_FILENAME'] == 'viewtopic.php') $image = "viewtopic_banner.png"; else $image = "another_banner.png";