Jump to content

Need Help with PHP Coding


kathysoebono

Recommended Posts

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...

 

tutore.jpg

 

tutor2.jpg

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.