Php Menus, How to?
I would like to have a submenu on a site I am building displayed when a user clicks a main navigation link. For example, the menubar is on two rows, one main row and another for sublinks. If I click on one option in the top row, then I get links for that in the bottom row.
I wanted to have my menu inserted into each page so that I can modify only one file to change my menu across the entire site. Is PHP suitable for this and can anyone point me to resources for developing such a system? Also is it possible to do this without using a database?
Thanks a lot,
To include your menu into every page you can use php's include function.
Just put that code where you want the menu to show.
When a user clicks on a main link does it send them to a new page and show the submenu or does it just show the new submenu?
Thanks for the reply. The menu will send them to a new page and show the submenu links.
Ok than to do it in php you would append a variable to each menu link like so
then where your sub menu is to show up you would do a simple if statement like so
if ($_GET['show'] == 'submenu')
$_GET will only work if you are running php>=4.1
If not use $HTTP_POST_VARS
That should do it I believe.