Please help Me!

Discussion in 'PHP' started by bhuvan4700, Apr 6, 2009.

  1. #1
    Hi All,

    I want a help regarding (include) file in php. I have a website of 100 pages for that I create header.php and footer.php. My website have two to three major categories. For that i create sub category in root folder like http://xyz.com/a/index.html.

    My code is running under root folder successfully but not in sub folder. This is my code

    <?php
    include ("include/header.php");
    ?>

    Please help me.

    Thanks
    Bhuvan
     
    bhuvan4700, Apr 6, 2009 IP
  2. AveragePro

    AveragePro Guest

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    .../ in PHP means "up a directory".

    So you would use -

    <?php
    include('.../include/header.php');
    ?>
     
    AveragePro, Apr 6, 2009 IP
  3. parthiphp

    parthiphp Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi


    put this code
    
     <?php
              $rootpath = $_SERVER['DOCUMENT_ROOT'];
              include($rootpath.'/include/header.php');
       ?> 
    
    PHP:
     
    parthiphp, Apr 6, 2009 IP