includes file

Discussion in 'Programming' started by johny2000, Apr 1, 2009.

  1. #1
    Can someone plaese help me with this I do not know what it all means .I am trying to make a includes file for my site .also i do not know where to find this info on my site and how to set it up.I am still a rookie at all this.
    Thank you
    www.askyourcook.com

    <html>
    (meta tags and links to stylesheet go here)
    <body>

    (include link for header goes here)

    Actual content for the page goes here

    (include link for the nav menu goes here)

    (include link for the footer goes here)

    </body>
    </html>
     
    johny2000, Apr 1, 2009 IP
  2. rowelle

    rowelle Active Member

    Messages:
    97
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    95
    #2
    This is what I use

    <?php include '/home/user/mydomain.com/file.php'; ?>
    Code (markup):
     
    rowelle, Apr 2, 2009 IP
  3. fadetoblack22

    fadetoblack22 Well-Known Member

    Messages:
    2,399
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    160
    #3
    3 Steps:

    1) Rename all your .html files to .php

    2) Put the code for header, footer etc... in separate files with .php extension also.

    3) In the main files where you want to use the header, footer put this: <?php include("header.php"); ?> <?php include("footer.php"); ?>
     
    fadetoblack22, Apr 2, 2009 IP