Probably a laughably easy answer, but I just can't figure it out.

Discussion in 'PHP' started by Lindz, Jun 24, 2007.

  1. #1
    Hi,

    since I am totally not experienced in programming, trying to learn everything I can.

    I want to build just a basic website that has the background, header, navigation(left navigationbar) and footer be the same on every page, but be a simple file to change vs. changing it on all the pages.

    I had a coder build one of my sites using php for this, I just am not savvy enough to figure out how to do it

    Is it a combinatino of Css/php? I bet it's totally simple, I just can't figure it out.

    help!
    Lindz
     
    Lindz, Jun 24, 2007 IP
  2. melol2

    melol2 Active Member

    Messages:
    511
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #2
    put all html and stuff that you want on every page in a single file, or multiple files. and wherever you want that in the page, use php

    include('header.html');
     
    melol2, Jun 24, 2007 IP
  3. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #3
    css and php have nothing to do with one another. the css provides the visual aspects to the actual markup for the website. all the php does is tells it what markup to display and where. serverside. html and css are both client side. as for the pages you're trying to do. create your page. write it all in one page with lipsum for the content or something. then after that, cut it all the way to where the content starts and save that in a file called header.php and then where the content ends, cut that to the last </html> tag and call that footer.php and then start a new page and do something along the lines of

    
    <?php
        include("header.php");
    ?>
    
    <h1>Some content here.</h1>
    <p>
        Some description of whatever content that you are displaying or whatever 
        html code you want in the content portion of your website.
    </p>
    
    <?php
        include("footer.php");
    ?>
    
    PHP:
     
    ansi, Jun 24, 2007 IP