Hello
I'am generating my menu from a function using variables from arrays of items,
the index page has the following code
<body topmargin="0">
<?
//DECLARING ROOT VARIABLES
$web_root="http://localhost/wembadesign2";
$server_root="d:/WEBSITES/2005/wembadesign2/";
//LOADING VARIABLES AND FUNCTIONS
include("$server_root/lib/variables_en.php");
include("$server_root/lib/functions.php");
//LOADING ROOT FILES
include("$server_root/headers.php");
include("$server_root/top.php");
include("$server_root/body.php");
include("$server_root/footer.php");
?>
these are my arrays of items for the menus
//MENU ARRAYS
//1
$menu_mainmenu=array(1,"Main Menu","What's So Special ?","Fast & Free Updated","Packages","What Does It Cost ?","Is It Worth It ?","What do I Need ?","Getting Started","Order Now");
//2
$menu_packages=array(2,"Our Packages","Starter","Premium","Silver","Gold","Platinum");
//3
$menu_news=array(3,"News","News","Events","Reviews");
//4
$menu_top=array(4,"Home","Home","About the Project","Mailling List","Policies","Contact Us","Back To Wemba.com");
?>
this is the function generating the menus
<?
// FUNCTION TO GENERATE MENUS FROM MENU ARRAYS
function show_menu($menu){
global $web_root, $server_root;
$menu_total=count($menu);
echo "<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td background='$web_root/images/gradient_menu.gif' valign='middle'>
<table width=100% border=0 cellpadding=2 cellspacing=1>
<tr><td background='$web_root/images/gradient_menu.gif' align='center'>
<font class=menuTitles><center><b> $menu[1] </b></font>
</td></tr>";
$bg=array("#ffffff");
//and(time());
shuffle($bg);
for ($i=2;$i<$menu_total;$i++){
$total_bg=(count($bg)-1);
//gID=rand(0,$total_bg);
$bgID=$menu[0];
$bgcolor=$bg[$bgID];
echo "<tr>
<td bgcolor=$bgcolor>
<img src='$web_root/images/green_arrow.gif' border=0 alt='green arrow'> <font class=mainContent><a href='$web_root/?link=$menu[0]$i'>$menu[$i]</a></font></td></tr>\n";
}
echo "</table>
</td></tr></table> ";
}
?>
this is the main page in which i include my pages file.tpl
<td>
<?
//Link ID correction
if (isset($link))
{
$link="";
}
else
{
$link=$link;
}
switch ($link)
{
//1 Main Contain
case 12 :include("$server_root/templates/contain/template_sospecial.tpl"); break;
case 13 : include("$server_root/templates/contain/template_updated.tpl"); break;
case 14 : include("$server_root/templates/contain/template_intropackages.tpl"); break;
case 15 : include("$server_root/templates/contain/template_cost.tpl"); break;
case 16 : include("$server_root/templates/contain/template_worth.tpl"); break;
case 17 : include("$server_root/templates/contain/template_need.tpl"); break;
case 18 : include("$server_root/templates/contain/template_start.tpl"); break;
case 19: include("$server_root/templates/contain/template_order.tpl"); break;
//2 Packages
case 22 : include("$server_root/templates/packages/template_Pstarter.tpl"); break;
case 23 : include("$server_root/templates/packages/template_Ppremium.tpl"); break;
case 24 : include("$server_root/templates/packages/template_Psilver.tpl"); break;
case 25 : include("$server_root/templates/packages/template_Pgold.tpl"); break;
case 26 : include("$server_root/templates/packages/template_Pplatinum.tpl"); break;
//3 News
case 32 : include("$server_root/templates/news/template_Nnews.tpl"); break;
case 33 : include("$server_root/templates/news/template_Nevents.tpl"); break;
case 34 : include("$server_root/templates/news/template_Nreviews.tpl"); break;
//4 Top Menu
case 42 : include("$server_root/templates/template_home.tpl"); break;
case 43 : include("$server_root/templates/contain/template_about.tpl"); break;
case 44 : include("$server_root/templates/contain/template_mailling.tpl"); break;
case 45 : include("$server_root/templates/contain/template_policies.tpl"); break;
case 45 : include("$server_root/templates/contain/template_contact.tpl"); break;
default : include("$server_root/templates/contain/template_policies.tpl");
}
?>
</td>
my menu doesn't work
but the default value of the switch are displayed normally, please tell me what is wrong ?
regards