kathysoebono Posted June 30, 2010 Share Posted June 30, 2010 Need help with PHP coding please, i have search in several forum and googling but not find the answer. My point is : PHP connect to MySql database. The menu have 4 till 6 sub menu level. the content div only change if the link was clicked. the procedure is like this If menu in content A click will change (Content B, Content C, Content D, Content E) If menu in content B click will change (Content C, Content D, Content E) If menu in content C click will change (Content D, Content E) If menu in content D click will change (Content E) associated with the menu as mentioned on the picture the content change the div only not the whole pages, and perhaps the url address will be like this (index.php?id=1&Bid=2&Cid=1&Did=5&Eid=3) the "&XXXid" indicate that the content has been clicked. Many appreciated for the support and help for my question. Thanks... Quote Link to comment Share on other sites More sharing options...
travo1992 Posted June 30, 2010 Share Posted June 30, 2010 Use switch statements to determine what to show for each of your menus, then show as a template underneath all of your working. Quote Link to comment Share on other sites More sharing options...
kathysoebono Posted June 30, 2010 Author Share Posted June 30, 2010 Use switch statements to determine what to show for each of your menus, then show as a template underneath all of your working. Do you mean swicth page could change the whole thing? whether examples like this? $content= "A"; switch ($content){ case "A": ($content B),($content C),($content D),($content E) "; break; case "B": ($content C),($content D),($content E) "; break; case "C": ($content D),($content E) "; break; case "D": ($content E) "; break; } perhaps i need more example code if you like show the code to me please. thanks Quote Link to comment Share on other sites More sharing options...
travo1992 Posted June 30, 2010 Share Posted June 30, 2010 Sure. Im thinking something like <?php $aid = $_GET['aid']; // repeat for other menus switch($aid){ case 1: $menu_a = 'blah';// 1st menu text break; //etc } // repeat for other menus ?> And then display them by simply echoing the relevant variable ($menu_a, $menu_b, etc) Hope that helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.