I'm having a problem with the navigation on the site I'm working on. Everytime I click on the link I get page not found and in the address bar of my browser this shows " http://www.somedomain.com/test2/<?php%20echo%20$PHP_SELF%20?>?main=page6 "
here's the coding for the menu.php
<?php
echo '
<br />
<br />
<br />
<br />
<br />
<br />
<a href="<?php echo $PHP_SELF ?>?main=page1">page1</a><br />
<a href="<?php echo $PHP_SELF ?>?main=page2">page2</a><br />
<a href="<?php echo $PHP_SELF ?>?main=page3">page3</a><br />
<a href="<?php echo $PHP_SELF ?>?main=page4">page4</a><br />
<a href="<?php echo $PHP_SELF ?>?main=page5">page5</a><br />
<a href="<?php echo $PHP_SELF ?>?main=page6">page6</a><br />
<a href="<?php echo $PHP_SELF ?>?main=page7">page7</a><br />
<a href="<?php echo $PHP_SELF ?>?main=page8">page8</a><br />
<a href="<?php echo $PHP_SELF ?>?main=page9">page9</a><br />
<a href="<?php echo $PHP_SELF ?>?main=page10">page10</a><br />';
?>
and this part is in the body.php that deals with the navigation
$main = (isset($_GET['main']))? $_GET['main'] : "main";
function storeCategory(){
$mainContent = array(
if($show == 0) { include "page1.php"; },
if($show == 1) { include "page2.php"; },
if($show == 2) { include "page3.php"; },
if($show == 3) { include "page4.php"; },
if($show == 4) { include "page5.php"; },
if($show == 5) { include "page6.php"; },
if($show == 6) { include "page7.php"; },
if($show == 7) { include "page8.php"; },
if($show == 8) { include "page9.php"; },
if($show == 9) { include "page10.php"; },
);
return $category;
}
function getContent($id){
$content = storeCategory();
for($x=0; $x<sizeof($content); $x++){
if (rtrim(ltrim($content[$x]["id"])) == $id){
$print_content = rtrim(ltrim($content[$x]["page"]));
}
return $print_content;
}
switch ($x){
case "page2":
include ('page2.php');
break;
case "page3":
include ('page3.php');
break;
case "page4":
include ('page4.php');
break;
case "page5":
include ('page5.php');
break;
case "page6":
include ('page6.php');
break;
case "page7":
include ('page7.php');
break;
case "page8":
include ('page8.php');
break;
case "page9":
include ('page9.php');
break;
case "page10":
include ('page10.php');
break;
default:
include ('page1.php');
}
}
I just can't figure out if it's a typo somewhere that I'm overlooking or what. Or did I get my coding wrong? for the navigation part?