summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2008-05-01 20:15:35 -0700
committerArun Persaud <arun@nubati.net>2008-05-01 20:22:08 -0700
commit64f953012ebda0912a4e92ff3301f09957019477 (patch)
tree5bb859db378c58565331d557b9a503c7fc09c4ac /index.php
parent5aa7d5dd2d0b487188fef191c6e5ef38f13e38f7 (diff)
downloade-DoKo-64f953012ebda0912a4e92ff3301f09957019477.tar.gz
e-DoKo-64f953012ebda0912a4e92ff3301f09957019477.tar.bz2
e-DoKo-64f953012ebda0912a4e92ff3301f09957019477.zip
CLEANUP: moved the statistics page into the include directory
added action=stats and moved the stats.php page to the include directory. Now we have a nice small index.php. Also moved the session_start in front of the includes, since it gave me an error on the mac otherwise?! Signed-off-by: Arun Persaud <arun@nubati.net>
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';