PHP 

Mutliple page in a single php file Switch Case

0
This is a simple PHP code to create a multiple pages in a single php files using Switch case.

Hope it will be useful for beginners.


Here is the code :

Code:
<?php

// www.Vidyarthiplus.com

switch ($_GET['page']) {
case '1' :
echo 'This is page 1';
break;
case '2' :
echo 'This is page 2';
break;
case '3' :
echo 'Script from : www.Vidyarthiplus.com/vp';
break;
default:
       echo "put index.php?page=1 - to see First page";
}
?>

Copy and paste the code in your php page, such as index.php

Usage :
To open the first page :
www.ur site link.com/index.php?page=1

To open the second page :
www. ur site link.com/index.php?page=2

Bu using this u can use many pages in a single php file and default statement displays the main page without any page number.

Hope i explained clearly..Smile If u have any doubt feel free to post ur comment below.,..
For the student , by the student , to the student !!

    Mutliple page in a single php file Switch Case