A PHP/MySQL HierMenus Generation Interface - (4/4) | WebReference

A PHP/MySQL HierMenus Generation Interface - (4/4)

To page 1To page 2To page 3current page

A PHP - MySQL Interface for HierMenus 4

Status of development

HierMenus is an evolving program undergoing continuous upgrades. It is, therefore, expected that certain things in this interface may require change as HierMenus changes with time. But the database structure need not necessarily change unless the number, name and purpose of the variables change in HierMenus. Additional fields may be needed in the future to take care of additional features added to HierMenus. The database tables and the code will require alignment with any future changes in the JavaScript array formats.

I will admit that I have not tested the interface for all possible combinations that HierMenus allows. I will, therefore, be glad to receive your comments and feedback to enable me to keep this interface updated and in line with HierMenus.

Expandability and scope

Oh yeah! I mentioned something about dynamic menu generation and the possibility of context sensitive menus. If you have the database support, then it is possible to have additional fields to take care of any context reference and more than one record can have the same array suffix but with different context references. This means that you can have one database with various menu trees each triggered in a different context.

Another example could be a shop front with categories and sub-categories stored in a database. You may wish to use HierMenus to dynamically show categories and sub or sub-sub categories depending on whatever is in the database. You certainly do not want to tinker with the JavaScript arrays every time a category is introduced or deleted. No worry! With a little modification of this interface depending on the category database structure, you can dynamically generate hierarchical menus with all the bells and whistles of HierMenus.

These are just a few examples. I can think of many more uses.

Demo and download

You can see HierMenus with MySQL database and the PHP interface in operation in the PHP Download section of http://www.creativephp.com. I have deliberately used the same array values as in the HierMenus example, but maybe with different parameters. It is operating off a database and there is no HM_Arrays.js file. You can download the PHP interface directly from that demonstration page.


About the author:

J. Chakrabarty (known as JC) runs www.creativephp.com, which develops Web sites for small to medium business. Integration of JavaScript and PHP for optimum speed and efficiency of a Web site is one of his areas of interest. His programs have been published in www.zend.com, www.hotscripts.com, and other Web developers' sites. JC can be contacted at webmaster@creativephp.com or jay_chack@yahoo.com.

To page 1To page 2To page 3current page

Written by J. Chakrabarty and
Created: September 24, 2001
Revised: September 24, 2001

URL: http://webreference.com/programming/php/hierphp/4.html