h1 tags around a piece of text only on homepage using PHP ?

Discussion in 'PHP' started by letsmakeamillion, May 24, 2007.

  1. #1
    Hey everyone,

    I have a header section on a forum that repeats throughout the forum and so if I put <h1> tags around a piece of text in that header section, the h1 tags will be around that piece of text throughout the whole site..

    but is there some php I can use so that the h1 tags around that piece of text only show up on the home page? but on the rest of the pages it just shows the text and not the surrounding h1 tags ?

    ie.

    Home Page would have:

    <h1>My Forum</h1>
    body
    content
    etc. etc.


    But all other pages would have

    My Forum
    body
    content
    etc. etc.


    Thanks in advance for any help !
     
    letsmakeamillion, May 24, 2007 IP
  2. manilodisan

    manilodisan Peon

    Messages:
    224
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <?php
    
    if (eregi("myIndexPage.php", $_SERVER['PHP_SELF'])) {
    
    echo '<h1>My Forum</h1>';
    
    }
    else {
    
    echo 'My Forum';
    
    }
    ?>
    PHP:
    myIndexPage.php = the page where you want h1 to appear
     
    manilodisan, May 24, 2007 IP