$action = (isset($_GET['action']) ? $_GET['action'] : 'index');
switch ($action) {
case 'page1':
require_once('page1.php');
$tpl = 'page1';
break;
case 'page2':
require_once('page2.php');
$tpl = 'page2';
break;
case 'index':
require_once('index.php');
$tpl = 'index';
break;
default:
$tpl = '404';
}
require_once($tpl . '.tpl.php');