Hi,
I was wondering what is the best way to load a menu from one place rather than adding additional parts of a menu to each page of a website.
Many Thanks.
Ian
Hi,
I was wondering what is the best way to load a menu from one place rather than adding additional parts of a menu to each page of a website.
Many Thanks.
Ian
Well, you could either use ajax, or PHP. I'd suggest using PHP, not all browsers and people support javascript & ajax. If you can use PHP that'd be good. Heres what you do:
Make a file called menu.html, this will hold your menu, so put your menu code in there.
Every file but menu.html(this is optional to have it.) Should have a .php extension. So, where you wanna put your menu, you can just do this:
Hope this Helps,Code:<?php include('menu.html'); ?>
Nile
Jeremy | jfein.net
johnsoip (04-17-2008)
Thanks, I'll give this a go.
Ian
But you have to make sure that your host allows PHP, what host do you use? If you tell me I might beable to tell you if they do.
Jeremy | jfein.net
I'm using 123-reg, I don't think they do actually.
Ian.
Yeah, looks like they support PERL though... I think you should get a different host or email them to ask if they can give you PHP.
Hope this Helps,
Nile
Jeremy | jfein.net
If you cannot use PHP, you could try this solution.
---
Arie Molendijk.
Bookmarks