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 6 of 6

Thread: Navigation bar

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    11
    Member #
    17847
    Hi all,

    I've created a website for internal use only. The site has a Navigation Bar/Frame and every page uses this Navigation bar.

    What I would like to do is have the navigation bar on a page of its own so that when it needs to be changed I only have to change it on one page instead of having to go to every page on my website and change the same code. Im just not sure how I would call the navigation bar page from withing another webpage.

    If anyone knows how this is done I would love to know.

    Thanks in adcance
    CC30

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Hi cc30.

    What you are asking is quite a common question so there are lots of other threads on this issue.

    The simplest way is using a server side solution. If your web host supports ASP (Classic or .Net) or PHP then you are all set.

    Basically this is how it works.

    Code:
    <html>
    <head>
    
    <body>
    
    <?php
       include("path/to/file.php");
    ?>
    
    </body>
    </html>
    Now when that page is parsed the contents of the file (which in my example is called path/to/fille.php) is placed where the include line is.

    With this in mind you will have to edit the pages you want to include the menu/navigation once to have the include line, but once that is done any changes made to the menu/navigation file will display on any page that includes the file.

    DOes your web host support any server side languages?

  4. #3
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    I'm also trying to learn php. Now he has to rename his pages with the file extension .php correct? Also, does the nav bar have to be a seperate file uploaded to the server? If so, is it another php file or an html file?

  5. #4
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    If the original poster chooses to use PHP then he can either rename his/her pages to .php or edit his .htaccess files to parse HTML pages as .php. I prefer to name my php pages to .php and leave my HTML files with the .html extension.

    The file he includes has to be another file on the server and can be either a HTML file or a PHP file, (well any file you want to include really).

    Although again, if it only HTML you want to include then I say have the menu as a HTML file.

    If you have any PHP in the file you wish to include do NOT save it as a .inc file.

  6. #5
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    Another question bfsog, is it necessary to have a local server such as Apache to test? I have broadband, DW with excellent ftp, and my host supports everything. The installment and cofiguration seems a little daunting and I'm thinking it might be easier to just test online as I go.

  7. #6
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    What your asking is not directly aimed at the question at hand, but I would say it is worthwhile having PHP and a DMBS setup on your own computer.

    What if your host is down? With a local server you can just place the files in the correct directory and test your pages there.

    It really is up to you though.


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 09:23 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com