Thanks for your help, I find out some ways but other error occur
1. When user view the index.php page, there is nothing to show => details of content.php should be displayed either when user view the website or user click on home button.
2. When I press ABOUT ME menu button, details of content.php are also displayed with details of aboutme.php
This is my code in the first way:
Code:
<div id="menu">
<ul>
<li><a href="index.php?page=content" name="content">Home </a></li>
<li><a href="index.php?page=aboutme" name="aboutme">About Me</a></li>
<li><a href="index.php?page=portfolio" name="portfolio">Portfolio</a></li>
<li><a href="index.php?page=contact" name="contact">Contact </a></li>
</ul>
</div>
Code:
<?php
if (isset($_GET['page']))
{
if($_GET['page']=="content")
include "content.php";
elseif($_GET['page']=="aboutme")
include "aboutme.php";
elseif($_GET['page']=="portfolio")
include "portfolio.php";
elseif($_GET['page']=="contact")
include "contact.php";
else
include "content.php";
}
?>
Besides that, I also use Switch Case to do quick navigation but error also come up:
Code:
<?php
switch($_GET["page"])
{
case "content":
require("content.php");
break;
case "aboutme":
require("aboutme.php");
break;
case "portfolio":
require("portfolio.php");
break;
case "contact":
require("contact.php");
break;
default:
require("default.php");
break;
}
?>
The error of this second way is :
Notice: Undefined index: page in C:\wamp\www\missvn\aa\index.php on line 11
and It is
Code:
switch($_GET["page"])
Can any one show me the solutions of 2 ways: using IF ELSE, INCLUDE Method and using SWITCH CASE method ?
Bookmarks