PHP Navigation
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
switch($a) { //$page is the url, ie ?page=xxx you can change $page to anything and it will change the URL's {
default: //default page to include
include('main.php');
//other files - rembmer to link your files to whatever.com?page=whatever - try changing $page at the top of the script to nothing, see if that makes it just ?=sdg, otherwise change it to something else, ie $var would make the URL's .php?var=sdg
break;
case "tutorials":
include('tutorials.php');
break;
case "contact":
include('contact.php');
//add more of these as needed
break;
case "VAR": //VAR is at the end of the url, so if somebody types in ...?=VAR it will include the file mentioned below
include('contact.php');
break;
} //End switch
?>
if you want ?a=page&b=anotherpage Just add another switch! like so...
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
case "page2":
switch($b) {
default:
include('page2.php');
break;
case "page3":
include('page3.php');
break;
}
break;
//I wont explain that because it is the same thing up top
?>