2 error_reporting(E_ALL);
4 include_once("config.php"); /* needs to be first in list, since other includes use this */
5 include_once("./include/output.php"); /* html output only */
6 include_once("./include/db.php"); /* database only */
7 include_once("./include/functions.php"); /* the rest */
9 /* make sure that user has set all variables in config.php */
12 /* open the database */
16 echo "Database error, can't connect... Please wait a while and try again. ".
17 "If the problem doesn't go away feel free to contact $ADMIN_NAME at $ADMIN_EMAIL.";
22 /* start a session, if it is not already running.
23 * This way people don't have to log in all the times.
24 * The session variables can also be read out from different
25 * php scripts, so that the code can be easily split up across several files
29 /* done major error checking, output 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 * the script checks if these are set via "myisset"
35 * which can check a list of variables.
38 /* does the user want to log out? */
41 require './include/logout.php';
43 /* check if we want to start a new game */
44 else if(myisset("new"))
46 require './include/newgame.php';
48 /*check if everything is ready to set up a new game */
49 else if( myisset("PlayerA", "PlayerB","PlayerC","PlayerD","dullen","schweinchen","callrule" ))
51 require './include/newgameready.php';
53 /* cancel a game, if nothing has happend in the last N minutes */
54 else if(myisset("cancel","me"))
56 require './include/cancelgame.php';
58 /* send out a reminder */
59 else if(myisset("remind","me"))
61 require './include/reminder.php';
63 /* handle request from one specific player for one game,
64 * (the hash is set on a per game base) */
65 else if(myisset("me"))
67 require './include/game.php';
69 /* user status page */
70 else if( myisset("email","password") || isset($_SESSION["name"]) )
72 require './include/user.php';
74 /* default login page */
77 require './include/welcome.php';