View Single Post
Old 07-02-2008, 07:34 PM   #5 (permalink)
drewbee
The Acquainted
 
drewbee's Avatar
 
Join Date: May 2008
Posts: 175
Thanks: 9
drewbee is on a distinguished road
Default

and If you must dynamically include files, dont use variables to do it. Use some type of switch, of which you hard code the file names.

IE

PHP Code:
$file '';
switch (
$_GET['page'])
{
    case 
'login':
    
$file 'login.php';
    break;
 
    case 
'register':
    
$file 'register.php';
    break;
 
    case 
'contact':
    
$file 'contact.php';
    break;
 
    default:
    
$file 'index.php';
}
 
if (
file_exists($file))
{
    include(
$file);

__________________
There are No Stupid Questions. But there a LOT of Inquisitive Idiots.
Send a message via AIM to drewbee
drewbee is offline  
Reply With Quote