Need help please: HTML conflict

Discussion in 'HTML & Website Design' started by henryhavoc, Aug 11, 2007.

  1. #1
    Hey gang,

    I've been wondering how I can get this done.

    Say I have five pages:

    page1.html
    page2.html
    page3.html
    page4.html
    page5.html

    And on each of those pages, I want to have 3 links on a nav-bar. Say one to the index.html, one to videos.html, and one to pictures.html. If I want to add another link, I don't want to have to go through all five pages and edit each one. Is there a way I can have a links.html page, and then put some code into my pages so when I want to add a new link, I can just put it into links.html and all my pages will update? Thanks a bunch.
     
    henryhavoc, Aug 11, 2007 IP
  2. uniqueasitis

    uniqueasitis Peon

    Messages:
    661
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You would have to use a scripting language such as php, asp, or jsp to do that. You would create a central file and have all other files read from the central navgation file using the scripting language.
     
    uniqueasitis, Aug 11, 2007 IP
  3. henryhavoc

    henryhavoc Banned

    Messages:
    252
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Is there a place I can find a tutorial for this? Thanks.
     
    henryhavoc, Aug 11, 2007 IP
  4. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #4
    kentuckyslone, Aug 11, 2007 IP
  5. uniqueasitis

    uniqueasitis Peon

    Messages:
    661
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You would have to learn the whole scripting langauge.

    Or try this.

    Create a file and name it nav.php. Now put all your links in that file. Now change the extension of all your other html files to php. And add this code to them where you would like the links to appear

    <?
    $path = "Put the path to the nav file you created here."
    include $path;
    ?>

    The only thing is that now you will need a server like xampp to run your website. You can download the serve for free from

    http://www.apachefriends.org/en/xampp-windows.html.
     
    uniqueasitis, Aug 11, 2007 IP
  6. hasan_889

    hasan_889 Banned

    Messages:
    303
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Even if you are not interested in learning any language, still you can use dreamweaver or textpad to Find & Replace in a specific folder and add the link in every page.
     
    hasan_889, Aug 11, 2007 IP
  7. henryhavoc

    henryhavoc Banned

    Messages:
    252
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I learn fast, and I was able to use the include command to fix my navigation, advertisements, and even my sponser links. Thankyou very much guys ^-^
     
    henryhavoc, Aug 11, 2007 IP
  8. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #8
    Or simpler just use,

    <? include $file location;?>

    Also a quick tip, instead of using <? echo $variable; ?> use <?=$variable?>

    Less code, quicker load times :)
     
    Silver89, Aug 11, 2007 IP