Mukhbir

 
  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • green color
  • blue color

Using GET variables to show different content on page

E-mail Print PDF

This code will help to change the page when the page url is different and contains the variables to be used as GET as:

index.php?page=something

<?php
switch ($_GET['page']) {
case 'first':
$change = "first";
include('first.php');
break;

case 'second':
$change = "second";
include('second.php');
break;

default: //Set the default page if no variable is passed
$change = "main";
include('main.php');
break;
}
?>

Comments (0)Add Comment
Write comment
 
  smaller | bigger
 

busy
Last Updated ( Tuesday, 30 December 2008 18:57 )