PHP Classes

Dynamic Menu in PHP: Display an hierarchic menu stored in a MySQL table

Recommend this page to a friend!
  Info   Example   Demos   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 50%Total: 3,945 All time: 805 This week: 47Up
Version License PHP version Categories
multilevel-menu 1.0.2Freeware3HTML, Databases
Description 

Author

This class can be used to display an hierarchic menu stored in a MySQL table.

It retrieves the title and link URLs of items of a menu from a MySQL database product table.

The class generates HTML and Javascript to display the pull down menus with links according to the hierarchy of children and parent items retrieved from the database.

Picture of Pravin Sonawane
  Performance   Level  
Name: Pravin Sonawane <contact>
Classes: 4 packages by
Country: India India

Example

<?php
   
include("functions.php");
   
$db = new PHP_fun;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PHP/MySQL/Javascript Multilevel Drop Down Menu</title>
<script language="javascript">
    function redirect(url)
    {
        window.open(url) ;
        return false;
    }
    function showId(id)
    {
        var obj = document.getElementById(id);
        obj.style.display = 'block';
        return false;
    }
    function hideId(id)
    {
        var obj = document.getElementById(id);
        obj.style.display = 'none';
        return false;
    }
</script>
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
.aerial12
{
    font-family:Verdana;
    font-size:9px;
    font-weight:bold;
    text-decoration:none;
    color:#402903;
    background-color:#FCBB2B;
    text-transform:uppercase;
}

.aerial12over
{
    font-family:Verdana;
    font-size:9px;
    font-weight:bold;
    text-decoration:none;
    color:#402903;
    background-color:#FDCB55;
    text-transform:uppercase;
}

-->
</style>

</head>
<body>
<table width="776" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="center" valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="top" height="100"><?=$db->getMenu(0);?></td>
  </tr>
</table>
</body>
</html>



  Menu linkExternal page  
Screenshots (1)  
  • menu.jpg
  Files folder image Files (7)  
File Role Description
Image file arrow_white.gif Icon Image
Plain text file functions.php Class Class file
Plain text file menu.php Example This is actual file to run
Plain text file menu.sql Data Data base file.
Plain text file .deepsource.toml Data Auxiliary data
Plain text file LICENSE.md Lic. License text

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:3,945
This week:0
All time:805
This week:47Up
User Ratings User Comments (4)
 All time
Utility:71%StarStarStarStar
Consistency:71%StarStarStarStar
Documentation:-
Examples:71%StarStarStarStar
Tests:-
Videos:-
Overall:50%StarStarStar
Rank:2732
 
This pakage not work in local machine, i make a instalation o...
9 years ago (Hugo Alves)
0%Star
i need this package
14 years ago (saeed)
52%StarStarStar
An outstanding piece of work.
15 years ago (David Quirk)
70%StarStarStarStar
This is really usefull multilevel menu.
15 years ago (Mukesh More)
70%StarStarStarStar