Jump to content

Archived

This topic is now archived and is closed to further replies.

andy2006

menu question

Recommended Posts

Hi

I am trying to display list of links under the link just pressed.

heres my code (which works, but it lists under the top link all of the time)
[code]

<?php
if($get){
$i = 0;
$menuArray = array();
$subMenuArray = array();

do {
$menuArray[$i] = $row['title'];
echo'<tr><td><div class="serviceLinks"><a href="services2.php?service='.$menuArray[$i].'&page='.$menuArray[$i].'"> '.$menuArray[$i].$i.'</a></td></div></tr><tr><td>';

if ($getSubMenu){
echo'<table>';
$x=0;
//inner loop to generate the sub menu
do {
$subMenuArray[$x] = $rowSubMenu['pageTitle'];
echo'<tr><td><div><a href="services2.php?service='.$subMenuArray[$x].$x.'&page='.$subMenuArray[$x].'"> '.$subMenuArray[$x].'</a></td></div></tr>';
$x++;
} while ($rowSubMenu = mysql_fetch_assoc($getSubMenu));
echo'</table>';
}
echo'</td></tr>';
$i++;
} while ($row = mysql_fetch_assoc($get));
}

?>[/code]

Sorry about the formatting I couldn't get it right on the forum inputbox

Can anyone help

Cheers

Share this post


Link to post
Share on other sites
i'm not even gonna bother looking at your code, as you didn't bother to format it right or use code or php tags.  but judging from your question, it sounds to me like all you have to do is switch the position in your code in which they are echod.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.