Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/local/psa/home/vhosts/scriptzine.nl/httpdocs/theme/default/global.php:1) in /usr/local/psa/home/vhosts/scriptzine.nl/httpdocs/theme/default/global.php on line 2
Script Zine, Webmaster help in English and Dutch!
Script Zine, webmaster help in English and Dutch
TUTORIALS SCRIPTS FORUM CONTACT
partyfreaksz
A better safer ?page - Posted on: 27-09-2009 at 13:02

Member

Explanation in the script.

Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
if (isset($_GET['page'])) // Check ?page is set.
{
  
  
$page htmlspecialchars($_GET['page']); // Remove invalid characters.
  
  
if (file_exists($page .'.php')) // Does the page exists?
  
{
    include(
$page .'.php'); // Include page
  
}
  else 
// Page doesn't exist, include error page.
  
{
    include (
'404error.php'); // Error page.
  
}
}
else 
// ?page is not set, include home page.
{
  include (
'home.php'); // Home page
}

?>




This script was originally posted by partyfreaksz on 25/09/2009. Translated by wmikke on 27/09/2009
 
 

© Script Zine 2003-2010 - Script Zine Design - Hosting by: Mihosnet
Recommend: IE 6