General question re setting up navigation system...
Hi everybody,
I'm (reasonably) new to PHP coding, and am setting up a heirachical website where the base file is "index.php". I will be navigating by index.php?page=foo (although OT I will probably be using .htaccess to clean that up a bit )
As it is a small site I see no point in using a MySQL database, so I would like to include a "structure.php" file at the top of every page with the information in it. I am planning to use arrays to store the info:
etc, basically creating a nodal struture, where the keys of the outer array are the uID's of the page, and the pID key is the parent ID. This will (hopefully) let me easily do breadcrumbs / navigation menus.
The pageName will be used for the navigation elements, <h1> and in <title> etc. the URL key is the "foo" in index.php?page=foo.
It does have the drawback that (as far as I can see) I can't add pages in without re-numbering everything.
OK, so my questions are:
1) am I correct so far, and
2) is this the best way of doing things?
I want to use the milonic DHTML menu (http://www.milonic.com) and dtree (http://www.destroydrop.com/dtree) and have the elements of these dynamically created, so I need something I can relatively easily recurse through to get the complete structure.
Thanks!
Martin
Last edited by mixermanic; 08-31-05 at 05:15 PM.
Reason: missed something :)