Facts: I have 3 levels of pages nested one into another:
1st level: index.php
2nd level: header.php, body.php, footer.php
On the body php i have the menu with different options (lets call them aboutus, contactus)
3rd level: aboutus.php, contactus.php
For security reasons I have created functions in the 2nd and the 3rd level pages, to display them, so they are displayed in the parent page by invoking these functions.
The menu on the body.php page is rather programatically, it looks something like this:
if (isset($GET['menu_option'])) {
$menu_option = (get_magic_quotes_gpc()) ? $GET['menu_option'] : addslashes($_GET['menu_option']);
}
else {
$menu_option = "some_default_page.php";
}
switch ($menu_option) {
case "aboutus":
include("./aboutus/aboutus.php");
ShowAboutUs();
break;
case "contactus":
include("./aboutus/aboutus.php");
ShowContactUs();
break;
default:
include("some_default_page.php");
ShowSomeDefaultPage();
}
ShowAbousUs(), ShowContactUs(), ShowSomeDefaultPage() are the functions to call these pages, functions i have just told you about.
My problem is as it follows:
If I want to make a call from a 3rd level page (lets say contactus.php) to another 3rd level page (lets say 3rdlevelpage.php) i receive nothing. I have changed the menu script, adding the following code:
case "3rdlevelpage":
include("./3rdlevelpage.php");
Show3rdLevelPage();
break;
, and also checked the paths and everything
So for instance if i have on contact.php a hyperlink like index.php?menu_option=3rdlevelpage, index.php displays only the header.php, a bit of body.php and nothing from footer.php.
The problem is i guess due to the way i pass the URL variables from one page to another (the parent). I should have hyperlinks like index.php?menu_option=1&submenu_option=2. If i am right, how can i do this in php?
Thanks in advance,
Catalin