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
    Jun 2008
    Location
    England
    Posts
    2
    Member #
    16914
    This is a query rather than a request for help, I'm just curious.

    At the moment is I want to add or remove a link from my nav bar i'm having to go through every page and remove it from them indevidualy, which is very time consuming.
    Does anyone know a way to add or remove a link on all pages at the same time, I thought that CSS would help but it seems to only change the look of it, if anyone knows a better way pls post here

    This is the code for www.fictionzone.freemegs.net

    HTML
    <div id="bread">
    [<a href="http://www.fictionzone.freemegs.net/">Home</a>]&nbsp;[<a href="http://www.fictionzone.freemegs.net/mystories.html">My Stories</a>]
    &nbsp;[<a href="http://www.fictionzone.freemegs.net/mypoems.html">My Poems </a>]&nbsp;[<a href="http://www.fictionzone.freemegs.net/submissions.html">Submit Your Work</a>]
    &nbsp;[<a href="http://www.fictionzone.freemegs.net/submittedstories.html">Submitted Stories</a>]&nbsp;[<a href="http://www.fictionzone.freemegs.net/submittedpoems.html">Submitted Poems</a>]
    &nbsp;[<a href="http://www.fictionzone.freemegs.net/myfavouriteauthors.html">My Favourite Authors</a>]&nbsp;[<a href="http://www.fictionzone.freemegs.net/aboutme.html">About Me</a>]

    <br/>[<a href="http://fiction-zone.blogspot.com/">Blog</a>]&nbsp;[<a href="http://users2.smartgb.com/g/g.php?a=s&i=g25-27626-25">Guestbook</a>]
    &nbsp;[<a href="http://www.fictionzone.freemegs.net/contactus.html">Contact Me</a>]
    </div>

    CSS
    #bread {margin-top: 0px; margin-bottom: 10px; padding: 5px; border-top: solid 1px #000000; border-bottom: solid 1px #000000; background-color: #909090; text-align: left;}
    #bread a {margin-left: 2px; margin-right: 2px; color: #000000; text-decoration: none;}
    #bread a:hover {text-decoration: underline;}

    This is the code for www.horde.freemegs.net

    HTML

    <div id="navbar">
    <p>
    <a href="http://www.horde.freemegs.net">Home</a> |
    <a href="http://www.horde.freemegs.net/members.html">Members</a> |
    <a href="http://www.horde.freemegs.net/guides.html">Guides</a> |
    <a href="http://www.horde.freemegs.net/whatisvco.html">What Is VCO</a> |
    </p>
    </div>

    CSS


    #navbar {
    color: blue;
    }

    Sorry it's so long winded but this is the best way I could think to explain it.

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    Use PHP.

    You can either change your file extension from .html to .php,
    or use .htaccess to process all .html and .htm pages as PHP.
    Alternately, you can ask (or view) your webhost's control panel.
    They might have an option for that (process all HTML pages as PHP).

    You then take this whole part:

    Code:
    <p>
    <a href="http://www.horde.freemegs.net">Home</a> |
    <a href="http://www.horde.freemegs.net/members.html">Members</a> |
    <a href="http://www.horde.freemegs.net/guides.html">Guides</a> |
    <a href="http://www.horde.freemegs.net/whatisvco.html">What Is VCO</a> |
    </p>
    and save it as a file called: nav.php

    You then put this line in every page:

    HTML

    <div id="navbar">
    <?php include("nav.php");?>
    </div>


    Now, each page uses THE SAME file, so you only need to change
    that one file ... the change shows the same on all pages.

    Because your navigation is stored as a PHP file, you can use PHP scripting
    within that file to control various things, such as changing CSS classes
    for highlighting the current page link.


  4. #3
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    I go further and create headers and footers...

    The only bit that changes is the page content...

    ie.
    Code:
    <? include('header.inc.php'); ?>
    waffle waffle waffle
    <? include('footer.inc.php'); ?>
    Sean

  5. #4
    Junior Member
    Join Date
    Jun 2008
    Location
    England
    Posts
    2
    Member #
    16914
    Quote Originally Posted by seanmiller
    I go further and create headers and footers...

    The only bit that changes is the page content...

    ie.
    Code:
    <? include('header.inc.php'); ?>
    waffle waffle waffle
    <? include('footer.inc.php'); ?>
    Sean
    Sounds cool I'll give it a try


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