PHP Switch
Befor u start using this tutorial you need to deside what GET variable your navigation will use. For example, this tutorial will use $_GET['page'], this means that our links will be displayed as href='?page=about'>About
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
switch($_GET['page']) { //gets the case and you can edit 'page' to be what you like. example: ?page= or ?sitename=
case "about": // this is the case that the switch would display when clicked
include ('about.php'); //when the case is called it will display what page you have added. also u can add an echo instead of a include
break; //stops the case i believe
case "hello"://this is the case that the switch would display when clicked
echo "Hello world!";// this is display whatever text you add again u can change is to a include
break; //stops the case i believe
default: // default would be whatever page u want to be displayed befor someone clicks a link i use news.php
include ('news.php'); // page thats displayed befor a link is clicked or if someone tryed to access a page that isnt there.
break; //stops the case i believe
}