This tutorial will help you to get different pages by using links like "index.php?page=news".
Code of index.php:
The first part of the URL indicates what you want, in this case, we want page. Then the rest will determine what page will be displayed in function of the chosen case: news, files... You can add as many case as you want as long as you have created the pages (php files).
If the case you specified doesn't exist, then it will 'echo' (display) the message:
Code of index.php:
Code :
// hide source code
// hide line numbers
// hide source code
// hide line numbers
1 <?PHP
2 switch($_GET['page']){
3 case 'news':
4 include("news.php");
5 break;
6 case 'files':
7 include("files.php");
8 break;
9 default:
10 echo "Error, the requested page does not exist.";
11 break;
12 }
13 ?>
The first part of the URL indicates what you want, in this case, we want page. Then the rest will determine what page will be displayed in function of the chosen case: news, files... You can add as many case as you want as long as you have created the pages (php files).
If the case you specified doesn't exist, then it will 'echo' (display) the message:
Quote
Error, the requested page does not exist.
Donation:If you like our free quality work, make a donation by using Paypal and tell us what you would like to see improved on our site for the next few months. |
No comments yet













Page Info













