summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/index.php b/index.php
index d1d2926..77a2c5b 100644
--- a/index.php
+++ b/index.php
@@ -1,11 +1,20 @@
<?php
error_reporting(E_ALL);
+/* start a session, if it is not already running.
+ * This way people don't have to log in all the times.
+ * The session variables can also be read out from different
+ * php scripts, so that the code can be easily split up across several files
+ */
+session_start();
+
+
include_once("config.php"); /* needs to be first in list, since other includes use this */
include_once("./include/output.php"); /* html output only */
include_once("./include/db.php"); /* database only */
include_once("./include/functions.php"); /* the rest */
+
/* make sure that user has set all variables in config.php */
config_check();
@@ -19,13 +28,6 @@ if(DB_open()<0)
exit();
}
-/* start a session, if it is not already running.
- * This way people don't have to log in all the times.
- * The session variables can also be read out from different
- * php scripts, so that the code can be easily split up across several files
- */
-session_start();
-
/* done major error checking, output header of HTML page */
output_header();
@@ -63,6 +65,12 @@ switch($action)
case 'game':
require './include/game.php';
break;
+ case 'stats':
+ if(isset($_SESSION["name"]))
+ require './include/stats.php';
+ else
+ require './include/welcome.php';
+ break;
default:
if(isset($_SESSION["name"]))
require './include/user.php';