PDA

View Full Version : How does this website change it's sidebar?


fredice
29th October 08, 09:28 PM
I'm currently creating a website, using frames, but there's something on the side bar that I will constantly be needing to update. How do I update this information, without having to edit every single page?? The following website is an example of what I mean -

http://sugar.collybird.org/

Under 'Stats', that information is constantly updated, but how does the owner do that without editing every page??

I've heard something about 'includes'.. I don't know whether that's relevant!

spikemeister
29th October 08, 10:46 PM
Yep it looks like the page is using PHP includes, basically all it does is "includes" one page in another. Its often used for headers and footers or navigation menus when the content of these sections doesnt change. The menu is the same on every page so put this in a seperate file and include it in all the others. Edit the menu document and all the pages are edited.

To include page in PHP use the following code, it is worth researching further because things like include once and require are also possible.


<?php
include 'mymenu.php';
?>