SL8R.co.uk - Code Zone

Code, Code and Code

SL8R.co.uk - Code Zone header image 2

PHP: Page Inclusion using GET selection

April 18th, 2008 · No Comments

Sample code to handle page inclusion based on get values 

// parse the passed value
switch($_GET['page'])
{
  // check for page1
  case(’page1′):
  include ‘page1.php’;
  break;
  // check for page2
  case(’page2′):
  include ‘page2.php’;
  break;
  // send other enquiries to our 404 page
  default:
  include ‘page404.php’;
  break;
}

Tags: Code

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment