View Full Version : Updating a menu from one place
johnsoip
04-17-2008, 01:51 PM
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:
<?php include('menu.html'); ?>
Hope this Helps,
Nile
johnsoip
04-17-2008, 02:04 PM
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.
johnsoip
04-17-2008, 02:14 PM
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
molendijk
04-17-2008, 06:16 PM
If you cannot use PHP, you could try this solution (http://www.dynamicdrive.com/forums/showthread.php?t=28620).
---
Arie Molendijk.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.