Results 1 to 13 of 13
  1. #1
    Newbie BigEmpire's Avatar
    Join Date
    January 18th, 2005
    Location
    Wisconsin
    Posts
    24
    What should I use?
    I am currently working on a new site, and I want to have my navigation bar links be able to be updated, without having to go to each page and update it manually. What kind of language or script would I have to use to do this. I am good with HTML but that is about it. Any help would be appreciated.

  2. #2
    All Around Web Guy Cursal's Avatar
    Join Date
    January 18th, 2005
    Posts
    829
    search google for ssi Server Side Includes

    php includes work too



    --Brian
    Oregon Publishing: Web Development, Graphic Design, Domains & Marketing
    Deluxe Banners Bartender's Guide Cooking Jobs

  3. #3
    Member sendmemybill's Avatar
    Join Date
    August 6th, 2005
    Location
    St-Georges, Québec, Canada
    Posts
    105
    Do your design in your favorite html editor, change the file extension of this .html page to .php. Then do the design of your menu in a new html file, change the file extension of this .html page to .php too. Now where you would have put the menu in your index.php, put this:

    let's say that menu.php is the menu you want to include and is in the same directory of your index.php

    <?php include ("menu.php"); ?>
    I don't know how you design your pages, but everytime you will want your menu, call the include code above for your menu.php to be included. Of course your server will have PHP!
    "Effective people are not problem-minded; they're opportunity minded. They feed opportunities and starve problems."

  4. #4
    Full Member
    Join Date
    January 18th, 2005
    Location
    UK
    Posts
    273
    If you are running on Apache as the web server you don't need to change file types to be .php

    You can get the Apache webserver to pick up php code in .htm files by adding the folloing code to your .htaccess file in your root directory

    #-----------------------------------------------
    RemoveHandler .html .htm
    AddType application/x-httpd-php .php .htm .html
    #-----------------------------------------------


    As always there is no such thing as a free lunch do so the price in this case the webserver has to do a bit more work so there is a slight performance hit.

    Hope that helps

    Les

  5. #5
    Marketing Mistress Lectrickitty's Avatar
    Join Date
    June 15th, 2005
    Location
    Broken Bow, OK
    Posts
    336
    Quote Originally Posted by BigEmpire
    I am currently working on a new site, and I want to have my navigation bar links be able to be updated, without having to go to each page and update it manually.
    That's exactly what I've been trying to do for a long time now. I've read books on php, java, javascript, cgi, ssi, C+, etc. until I'm blue in the face. I've learned tons of useful stuff and wasted time learning tons of stuff I'll never use, but I still haven't figured out how to make a single links page that can be called with a code.

    It's probably so simple that I can't see it. Kind of like can't see the forest for the trees, or is it can't see the trees for the forest... either way it's elusive to me.

    It seems to me there should be a simple javascript code that would work, but I haven't figured it out yet. I found out how to do images using an external .js file, but it won't work with a navagation bar, or at least I haven't been able to make it work... yet.

    I'm almost to the point of giving up and paying someone to write it for me.
    [color=blue]"Those who give up their freedom for a little security deserve neither freedom nor security" - Benjamin Franklin[/color]

  6. #6
    Affiliate Manager Allen Nance's Avatar
    Join Date
    January 18th, 2005
    Location
    Colorado River, Bullhead City AZ
    Posts
    1,604
    Front Page Users
    For those that use Front Page, use the borders for universal top, bottom left nav or right.

    Poops

  7. #7
    Marketing Mistress Lectrickitty's Avatar
    Join Date
    June 15th, 2005
    Location
    Broken Bow, OK
    Posts
    336
    WOO HOOO!!!

    I just made it work!!!
    [color=blue]"Those who give up their freedom for a little security deserve neither freedom nor security" - Benjamin Franklin[/color]

  8. #8
    Full Member ahmar's Avatar
    Join Date
    January 18th, 2005
    Posts
    481
    As everyone said Server Side Includes are the way to go. Best option available for what you are trying to do. My knowledge is also limited to html but since I learned about SSI my biggest problem is solved. One simple line and there you are.

    Only thing you need to make sure that you insert the required code in .htaccess and your web hosts supports SSI.
    <DT>[size=1][color=navy]"The best measure of a man's honesty isn't his income tax return.[/color][/size]<DT>[size=1][color=navy]It's the zero adjust on his bathroom scale." Arthur C. Clark[/color][/size]</DT>

  9. #9
    Full Member
    Join Date
    January 18th, 2005
    Posts
    331
    Like the others say, SSI would be jsut what the doctor ordered..
    [SIZE=1][URL=http://www.tastelessandtacky.com]Tasteless and Tacky Gear[/URL][/SIZE]

  10. #10
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    I agree with sendmemybill's solution. I don't think SSI is a good solution because it's incompatible with PHP. The two aren't made to work together on the same document. Also, I believe more hosts support PHP than SSI. I consider SSI very old and outdated. If you don't expect to add any PHP in the future you can go with SSI, but be prepared to swap out your SSI if you ever decide to incorporate PHP.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  11. #11
    Member YetAnotherAffiliate's Avatar
    Join Date
    October 28th, 2005
    Location
    Ohio
    Posts
    48
    Perl

    somefile.cgi

    #!/usr/bin/perl
    require "../common.pl";
    &printhead;
    print "some content here";
    &printfoot;


    common.pl
    #!/usr/bin/perl

    sub printhead {
    print qq[
    <html><head><title></title></head>
    <style>
    html {
    background-image: url("../../images/bg.jpg");
    }
    div.content {
    background-image: url("bgc.jpg");
    }
    </style>
    <body>
    <!-- Begin Nav -->
    some nav menu
    <!-- End Nav -->
    <div class=content>
    ];
    }

    sub printfoot {
    print qq[
    <br><hr>
    <center><font=1>Copyright &copy 2005</font></center>
    </body>
    </html>
    ];
    }

  12. #12
    Full Member
    Join Date
    January 18th, 2005
    Posts
    331
    Quote Originally Posted by Snib
    I agree with sendmemybill's solution. I don't think SSI is a good solution because it's incompatible with PHP. The two aren't made to work together on the same document. Also, I believe more hosts support PHP than SSI. I consider SSI very old and outdated. If you don't expect to add any PHP in the future you can go with SSI, but be prepared to swap out your SSI if you ever decide to incorporate PHP.

    - Scott
    But if they change to PHP won't it hurt the page rankings when you change them from .html ??
    [SIZE=1][URL=http://www.tastelessandtacky.com]Tasteless and Tacky Gear[/URL][/SIZE]

  13. #13
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Quote Originally Posted by hotspice
    But if they change to PHP won't it hurt the page rankings when you change them from .html ??
    .html can be parsed as PHP by modifying your Apache settings. Then a 302 redirect can be used in the .html document to redirect to the new .php document. At least that's how I'd do it. That way you're telling the search engines that the page has moved and you don't lose any of your old traffic or rankings.

    Of course you can keep the .html extension and execute your PHP code within it, but I prefer the .php extension.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  14. Newsletter Signup

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •