Call us Toll-Free:
1-800-218-1525
Email us

 Sponsors

Tree Menu

Code Wizard, 12-30-2006

This is simple code to make tree menu.

<?php
if(isset($stat)){
$a = unserialize(base64_decode($stat));
}
if(isset($node)){
if(!isset($a[$node])){
$a[$node]=true;

} else {
if($a[$node]==true){
$a[$node]=false;

} else {
$a[$node]=true;

}
}
}
$stat = base64_encode(serialize($a));

echo "<table>";
echo "<tr><td><a href=$PHP_SELF?stat=$stat&statid=menu1&node=1>+</a></td><td>Menu</td></tr>";
if($a[1]){
echo "<tr><td>--</td><td>Testing1</td></tr>";
echo "<tr><td>--</td><td>Testing2</td></tr>";
}
echo "<tr><td><a href=$PHP_SELF?stat=$stat&statid=menu2&node=2>+</a></td><td>Menu2</td></tr>";
if($a[2]){
echo "<tr><td>--</td><td>Testing3</td></tr>";
}
echo "</table>";
?>
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions