No that wouldn't work... you'd have to make the allowed extensions an array and loop through them like this:
Code:
// The allowed extensions
$ext = array(".php",".jpg");
// Try every extension
foreach($ext as $extension)
{
// Build the id
$id = $id.$extension;
// Check if the file actually exists
if (file_exists($id))
{
// Include the file and make sure we know that it is included
include($id);
$included=true;
}
}
// If we have included something,
// don't include the main.php any more
if (!$included)
{
// Include the default main.php
include("main.php");
}