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 4 of 4
  1. #1
    Junior Member
    Join Date
    Aug 2014
    Posts
    2
    Member #
    40025

    New and confused - Separate file for nav menu?

    I'm trying to search the internet and articles here, it could be the answer is in front of me but I don't know the terms to recognize it. I would like to be able to keep my header, footer, and navigation on separate files then link to them, similar to frames but without using frames. I would like to avoid copying and pasting on many webpages as my site grows, every time I add or change something in my navigation.

    The CSS tutorials that I've found seem to be only to display the style of the menu, but the text is still written on the actual webpage, is what I would rather do possible? Can I do it by learning Java?

  2.  

  3. #2
    Junior Member
    Join Date
    Aug 2014
    Posts
    2
    Member #
    40024
    Maybe you can use php...

    <?php include ("header.php"); ?>

  4. #3
    Junior Member
    Join Date
    Aug 2014
    Posts
    2
    Member #
    40025
    Okay. I don't know that either, but if it will work, I'll go figure out how . Thank you.

  5. #4
    Senior Member
    Join Date
    Nov 2013
    Posts
    146
    Member #
    37737
    Liked
    15 times
    So, let's say you have a website index.html that has a header, body, and footer.
    Simply put the header which is like the logo, navigation, etc. in header.php
    then put the stuff between the header and footer in index.php
    and the footer (if you have one) in footer.php
    Then in your index.php it would look like this

    PHP Code:
    <?php require_once('header.php'): ?>
    <p>blah blah blah</p>
    <?php require_once('footer.php'): ?>


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