0) $action = substr($action,0,$p); $action = preg_replace("/[^a-z0-9_]/", "", strtolower($action)); $legal_actions = array('login', 'signup', 'guide', 'top10', 'credits', 'forums', 'source', 'profiles', 'rnews', 'features', 'hfame', 'license'); if(!stristr($config[sitedir], $_SERVER['HTTP_HOST'])) { Header("Location: $config[sitedir]"); exit; } if($config['pconnect']) $db_link = @mysqli_connect("p:$dbhost",$dbuser,$dbpass); else $db_link = @mysqli_connect($dbhost,$dbuser,$dbpass); if (mysqli_connect_error()) { require_once("html.php"); HTMLbegincompact("Database Error!"); print "The game database is currently unavailable. Please try again later.\n"; HTMLendcompact(); exit; } mysqli_select_db($GLOBALS["db_link"], $dbname); require_once("sql-setup.php"); if ($action == "game") $action = "main"; if(empty($action)) $action = "login"; $file = $action . ".php"; if(!is_file($file) || $file == 'login.php') { $action = isset($_POST['the_action']) ? $_POST['the_action'] : ''; $file2 = $action.'.php'; if(!is_file($file2)) $file = "login.php"; else $file = $file2; } $action = substr($file, 0, -4); $GAME_ACTION = $action; include("lib/ranks.php"); include("lib/raffle.php"); include("lib/maintenance.php"); include($file); ob_end_flush(); ?>