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
11 include_once("config.php"); /* needs to be first in list, since other includes use this */
12 include_once("./include/output.php"); /* html output only */
13 include_once("./include/db.php"); /* database only */
14 include_once("./include/functions.php"); /* the rest */
16 /* make sure that user has set all variables in config.php */
19 /* open the database */
23 echo "Database error, can't connect... Please wait a while and try again. ".
24 "If the problem doesn't go away feel free to contact $ADMIN_NAME at $ADMIN_EMAIL.";
29 /* done major error checking, output5B header of HTML page */
32 /* The rest of the file consists of handling user input.
33 * The user sends information via html GET and POST variables,
34 * and the action variable tells the prog what the user wants to do
37 $action=$_REQUEST['action'];
39 $action=""; /* so that we can use a default option below */
44 require './include/newgame.php';
47 require './include/cancelgame.php';
50 require './include/reminder.php';
53 require './include/logout.php';
54 require './include/welcome.php';
57 require './include/login.php';
58 require './include/user.php';
61 require './include/register.php';
64 require './include/preferences.php';
67 require './include/game.php';
70 if(isset($_SESSION["name"]))
71 require './include/stats.php';
73 require './include/welcome.php';
76 if(isset($_SESSION["name"]))
77 require './include/user.php';
79 require './include/welcome.php';
82 /* ask for login or display login info, needs to go at the end, so that we have the
83 * session-variable already set.