SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jul 2001
    Location
    Brisbane, Australia
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP4 headers and footers

    Im having problems calling files to using as a header and footer for my site. Im not good with php at all but this is what i have, and its not working:

    <?PHP
    include ('/header.html');
    ?>

    <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" width="700">
    <tr>
    <td>asdfasdfasdf</td>
    </tr>
    </table>
    </center>
    </div>

    <?PHP
    include ('/footer.html');
    ?>

    Can someone please point out what im doing wrong?
    IMinteractive.net Web Hosting and Development.
    Service with a

  2. #2
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    should header.html and footer.html be header.php and footer.php?

    John

  3. #3
    SitePoint Zealot Paul_M's Avatar
    Join Date
    Mar 2001
    Location
    London
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what error are you getting?

  4. #4
    will code HTML for food Michel V's Avatar
    Join Date
    Sep 2000
    Location
    Corsica
    Posts
    552
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: PHP4 headers and footers

    Originally posted by evilhaze
    <?PHP
    include ('/header.html');
    ?>
    My bet the error is the forward slash... instead of fetching the file in /home/your-account/www, it will try to fetch the file in /, which is the root directory of the server. You don't have html files in the root directory, do you ?
    [blogger: zengun] [blogware contributor: wordpress]

  5. #5
    SitePoint Member
    Join Date
    Jul 2001
    Location
    Brisbane, Australia
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got it working, i just needed to get rid of the / and change ' to "
    IMinteractive.net Web Hosting and Development.
    Service with a

  6. #6
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by johnn
    should header.html and footer.html be header.php and footer.php?

    John
    It does not matter what extension you use.

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •