2 error_reporting(E_ALL);
4 /* start a session, if it is not already running.
5 * This way people don't have to log in all the times.
6 * The session variables can also be read out from different
7 * php scripts, so that the code can be easily split up across several files
12 include_once("config.php"); /* needs to be first in list, since other includes use this */
13 include_once("./include/output.php"); /* html output only */
14 include_once("./include/db.php"); /* database only */
15 include_once("./include/functions.php"); /* the rest */
18 /* make sure that user has set all variables in config.php */
21 /* open the database */
25 echo "Database error, can't connect... Please wait a while and try again. ".
26 "If the problem doesn't go away feel free to contact $ADMIN_NAME at $ADMIN_EMAIL.";
31 /* done major error checking, output header of HTML page */
34 /* The rest of the file consists of handling user input.
35 * The user sends information via html GET and POST variables,
36 * and the action variable tells the prog what the user wants to do
39 $action=$_REQUEST['action'];
41 $action=""; /* so that we can use a default option below */
46 require './include/newgame.php';
49 require './include/cancelgame.php';
52 require './include/reminder.php';
55 require './include/logout.php';
56 require './include/welcome.php';
59 require './include/login.php';
60 require './include/user.php';
63 require './include/register.php';
66 require './include/preferences.php';
69 require './include/game.php';
72 if(isset($_SESSION["name"]))
73 require './include/stats.php';
75 require './include/welcome.php';
78 if(isset($_SESSION["name"]))
79 require './include/user.php';
81 require './include/welcome.php';