|
|
|
| Title : |
menu.php3 is a simple to use 2D menu system. Homepage: http://cow.active.ch/~mustun/phpfi/menu/ (with an example.) Tested with: Apache/1.3.2 (Unix) PHP/3.0.4 but should work on other versions also |
| Categories : |
HTML, PHP |
 Michael Mustun |
| Date : |
Jan 17th 1999 |
| Grade : |
3 of 5 (graded 6 times) |
| Viewed : |
5728 |
| File : |
No file for this code example. |
| Images : |
No Images for this code example. |
|
| Search : |
More code by Michael Mustun |
|
| Action : |
Grade This Code Example
|
|
| Tools : |
My Examples List |
|
|
|
|
|
|
NOTE: It's better to get it from the menu.php3 Homepage on
http://cow.active.ch/~mustun/phpfi/menu/.
Example included.
You need this files:
* menu.inc
* menu.php3
* menu_style.css
* index-tmp.html
* menu_footer.inc
* menu_header.inc
* menu_note.inc
menu.inc:
---------
<?
// menu.inc
$programTitleGUI = "Menu";
$programVersionGUI = "1.0.0";
/*
* Format: $menuName[$mainMenu][$subMenu]
*
*/
$main=0;
// -----------------------------------------------
// Tool
$main++;
$menuName[$main][0] = "Tool";
$menuAction[$main][0] = "tool_nslookup.php3";
$menuActionParam[$main][0] = "tool_nslookup";
$menuName[$main][1] = "nslookup";
$menuAction[$main][1] = "tool_nslookup.php3";
$menuActionParam[$main][1] = "tool_nslookup";
$menuName[$main][2] = "whois";
$menuAction[$main][2] = "tool_whois.php3";
$menuActionParam[$main][2] = "tool_whois";
// -----------------------------------------------
// -----------------------------------------------
$main++;
$menuName[$main][0] = "Menu2";
$menuAction[$main][0] = "content2_1.php3";
$menuActionParam[$main][0] = "content2_1.php3";
$menuName[$main][1] = "subMenu2";
$menuAction[$main][1] = "content2_1.php3";
$menuActionParam[$main][1] = "content2_1.php3";
$menuName[$main][2] = "subMenu2";
$menuAction[$main][2] = "content2_2.php3";
$menuActionParam[$main][2] = "content2_2.php3";
// -----------------------------------------------
?>
- - - - -
menu.php3:
----------
<?
/*
* example call
* menu.php3?menu=0&submenu=1&action=....
*
*/
$localdebug = 0;
$programName = "menu.php3";
$programVersion = "0.1.0";
$programAuthor = 'Michael Mustun <mustun@active.ch>';
include "menu.inc";
$localdebug = 1;
?>
<html>
<head>
<title></title>
<link rel="stylesheet"
type="text/css"
href="menu_style.css"
title="Style: Title">
</head>
<body>
<br>
<? include "menu_header.inc" ?>
<? include "menu_note.inc" ?>
<!-- -------------- -->
<!-- START mainmenu -->
<div
align=right
>
<table
border=1
align=left
cellpadding=6
cellspacing=2
>
<tr>
<td><div align=center><b> <? echo $programTitleGUI ?></b></div></td>
</tr>
<?
// for ($mainMenuNumber=0; $mainMenuNumber<=sizeof($menuName)-1; $mainMenuNumber++) {
for ($mainMenuNumber=0; $mainMenuNumber<=40; $mainMenuNumber++) {
if ( $menuName[$mainMenuNumber][0] != "" ) {
// only menu with data
echo "<tr ";
if ( $menu == $mainMenuNumber ) {
echo " bgcolor=#AAAAAA";
} else {
echo " bgcolor=#DDDDDD";
}
echo ">";
echo "<td>";
if ( $localdebug >= 1 ) {
echo "($mainMenuNumber)";
}
echo "<a href=menu.php3";
echo "?menu=" . $mainMenuNumber;
echo "&submenu=" . $submenu;
echo "&db_table=" . $menuTable[$mainMenuNumber];
echo ">";
echo $menuName[$mainMenuNumber][0];
echo "</a>";
echo "</td></tr>\n";
} else {
// no menu available
}
}
?>
</table>
</div>
<!-- END mainmenu -->
<!-- -------------- -->
<!-- -------------- -->
<!-- START submenu -->
<div
algin=right
>
<table
border=1
cellpadding=6
cellspacing=2
>
<tr>
<?
// for ($subMenuNumber=1; $subMenuNumber<=count($menuName[$menu])-1; $subMenuNumber++) {
for ($subMenuNumber=1; $subMenuNumber<=40; $subMenuNumber++) {
if ( $menuName[$menu][$subMenuNumber] != "" ) {
echo "<td ";
if ( $subMenuNumber == $submenu ) {
echo " bgcolor=#AAAAAA ";
} else {
echo " bgcolor=#DDDDDD";
}
echo ">";
if ( $localdebug >= 1 ) {
echo "($subMenuNumber)";
}
echo "";
echo "<a href=menu.php3";
echo "?menu=$menu";
echo "&submenu=" . $subMenuNumber;
echo "&db_table=" . $menuTable[$menu];
echo ">";
echo $menuName[$menu][$subMenuNumber];
echo "</a>";
echo "</td>\n";
} else {
// no menu available
}
}
?>
</tr>
</table>
</div>
<!-- END submenu -->
<!-- -------------- -->
<br>
<!-- -------------- -->
<!-- START content -->
<?
if ( ($menu != "") && ($submenu != "") ) {
// include the selected menu
$action = $menuActionParam[$menu][$submenu];
echo "\n<!-- menu=$menu; submenu=$submenu; db_table=$db_table -->\n";
include( $menuAction[$menu][$submenu] );
}
?>
<!-- END content -->
<!-- -------------- -->
<!--
<?
if ( $localdebug >= 1 ) {
echo "<pre>menu.php3: menu=$menu; submenu=$submenu</pre>";
}
?>
-->
<? include "menu_footer.inc" ?>
<!--
<hr noshade>
-->
</body>
</html>
<!-- EOF. -->
|
|
| Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP, PHP, HTML, PDF, Excel | | | Snipe.Net's Web Design Color Scheme Previewer- Allows uses to input hex
codes for their text, background, and link colors, and preview the color
scheme with their background image. Example:
http://www.snipe.net/tech/snipeschool/hex.php3 Categories : PHP, HTML and PHP, General, Graphics, HTML | | | The first step Guest Book ... ^^ Categories : MySQL, PHP, Apache, HTML, HTTP | | | ASCII To HTML Converter Categories : PHP, HTML, ASCII | | | How to get the source of a site into an array. Categories : Arrays, HTML, PHP | | | Display Slashdot headers on your own site Categories : HTML and PHP, HTML, PHP | | | Form is a utility class for generating html forms. It provides form initialization and regex based data validation (both server and client side) with a convenient interface. This version obsoletes version 1.0a Categories : HTML, PHP, PHP Classes, Regexps | | | Popup Menu 0.5, popup, select, html, state-maintaing Categories : HTML, PHP, HTML and PHP | | | Newbie Notes #10 - Generating drop downs Categories : PHP, MySQL, HTML, Beginner Guides, Databases | | | FormWizard reads a mysql table and generates automatically
a html formular in a html-table Categories : PHP, MySQL, HTML | | | Script to check values being submitted by POST or GET method from a form. This script may help diagnose what variables are being supplied by a browser to other php scripts. Categories : HTML, Variables, Debugging, PHP, HTTP | | | Take multiple text files and do simple formatting on them and add them to a webpage Categories : HTML, Filesystem, PHP | | | How to know which input button of type image was pressed in a form with
multiple image buttons (_x and _y) in PHP? Categories : PHP, Variables, HTML | | | How to preset a text string in a textarea input field Categories : HTML, HTML and PHP, PHP, Beginner Guides | | | How to use regular expressions to get the list of links from an HTML page Categories : PHP, Regexps, HTML, HTML and PHP | |
| |
| |
|