Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Sep 2004
    Posts
    2
    Member #
    7751
    I am starting to build a website. My basic layout plan looks something like this:

    ----------------------------------------------------
    *site name*

    *navigation bar with links to the various areas of the site*




    CONTENT




    -----------------------------------------------------

    Every page in the site will have the same title and navigation bar at the top, but with content, obviously, varying from page to page. The problem is that my site will consist of a lot of pages, and if I happen to change the design of my navigation bar at some point, I don't want to have to update every page. Is there some sort of script I can use that will allow each page to reference another document containing the script for the navigation section, without affacting its appearance in any way? (I certainly don't want to use frames... I want it to look completely normal, but allow , me to easily update just the top section.) Here's an example of the basic design idea: http://www.alternet.org/

  2.  

  3. #2
    Member Juvenall's Avatar
    Join Date
    Sep 2004
    Location
    #!/usr/bin/Detroit
    Posts
    67
    Member #
    7716
    The way I would go about it is to use PHP includes. I'm actually in the middle of writing a tutorial on the subject, but the quick and dirty of it is this:

    You would have two different files on your site. index.php and header.php.

    Your Index file would look something like this:
    Code:
    <html>
    <head><title>Title</title></head>
    <body>
    <?php include('path/to/your/header.php'); ?>
    <div>Here is your content</p>
    </body>
    </html>
    Then your header.php file would have this inside:
    Code:
    <?php
    echo '
    <div>This is my Header. <a href="#">Link 1</a> | <a href="#">Link 2</a></div>
    ';
    ?>
    You could then change the code in header.php and have the change take place on every page that calls that file. Very, very easy stuff to figure out and a great way to spark intrest in learning more PHP *grins*

    Of course you'll need a server that has PHP on it for any of this to actually work. If not, you can do the same thing through SSI, but I really don't like going about it that way (just me).

    Let me know if that helps :-). I hope to be done with the full tutorial in the next few days.
    Juvenall Wilson_______[juvenall@gmail.com]_________________
    Forum Directory - ForumFox.com
    YaBB Project Admin/Former allmusic.com designer


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:17 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com