tags:

views:

29

answers:

1

I have a generic include that contains secondary navigation, etc. that is included on every page of a site. It also contains a graphic that I want to appear on every page but the home page. I realize that it would be trivial to do this client side and just remove the node from the DOM on load on that one page, but for various reasons I want to do this server side.

I have this:

<?php
if ($_SERVER['REQUEST_URI'] == '/index.php') {
    echo "";
}
else {
    echo "<img src=\"img/foobar.gif\" width=\"60\" height=\"96\" alt=\"description\" />";
}
?>

This works for domain.com/index.php, but I can't figure out how to get it to work for both domain.com/index.php and domain.com/. My experiments with the OR operator caused the graphic to disappear from all pages (because every page includes the root domain in the path). Help me out PHP gurus!

A: 

try something like

if ($_SERVER['REQUEST_URI'] == '/index.php' || $_SERVER['REQUEST_URI'] == '/' )
Haim Evgi