2 error_reporting(E_ALL);
7 include_once("config.php");
8 include_once("output.php"); /* html output only */
9 include_once("db.php"); /* database only */
10 include_once("functions.php"); /* the rest */
15 echo "Working on the database...please check back in a few mintues";
23 /* check if we want to start a new game */
25 output_form_for_new_game();
27 /*check if everything is ready to set up a new game */
28 else if( myisset("PlayerA", "PlayerB","PlayerC","PlayerD" ))
30 $PlayerA = $_REQUEST["PlayerA"];
31 $PlayerB = $_REQUEST["PlayerB"];
32 $PlayerC = $_REQUEST["PlayerC"];
33 $PlayerD = $_REQUEST["PlayerD"];
35 $EmailA = DB_get_email_by_name($PlayerA);
36 $EmailB = DB_get_email_by_name($PlayerB);
37 $EmailC = DB_get_email_by_name($PlayerC);
38 $EmailD = DB_get_email_by_name($PlayerD);
40 if($EmailA=="" || $EmailB=="" || $EmailC=="" || $EmailD=="")
42 echo "couldn't find one of the names, please start a new game";
46 $useridA = DB_get_userid_by_name($PlayerA);
47 $useridB = DB_get_userid_by_name($PlayerB);
48 $useridC = DB_get_userid_by_name($PlayerC);
49 $useridD = DB_get_userid_by_name($PlayerD);
51 /* create random numbers */
52 $randomNR = create_array_of_random_numbers();
53 $randomNRstring = join(":",$randomNR);
57 if(myisset("followup") )
59 $followup= $_REQUEST["followup"];
60 mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,'1','pre','$followup' ,NULL)");
63 mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,'1','pre', NULL ,NULL)");
64 $game_id = mysql_insert_id();
67 $hashA = md5("AGameOfDoko".$game_id.$PlayerA.$EmailA);
68 $hashB = md5("AGameOfDoko".$game_id.$PlayerB.$EmailB);
69 $hashC = md5("AGameOfDoko".$game_id.$PlayerC.$EmailC);
70 $hashD = md5("AGameOfDoko".$game_id.$PlayerD.$EmailD);
73 mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridA).
74 ", ".DB_quote_smart($hashA).", 'start','1',NULL,NULL,NULL,'false','false',NULL)");
75 $hand_idA = mysql_insert_id();
76 mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridB).
77 ", ".DB_quote_smart($hashB).", 'start','2',NULL,NULL,NULL,'false','false',NULL)");
78 $hand_idB = mysql_insert_id();
79 mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridC).
80 ", ".DB_quote_smart($hashC).", 'start','3',NULL,NULL,NULL,'false','false',NULL)");
81 $hand_idC = mysql_insert_id();
82 mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridD).
83 ", ".DB_quote_smart($hashD).", 'start','4',NULL,NULL,NULL,'false','false',NULL)");
84 $hand_idD = mysql_insert_id();
88 mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idA', '".$randomNR[$i]."', 'false')");
90 mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idB', '".$randomNR[$i]."', 'false')");
92 mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idC', '".$randomNR[$i]."', 'false')");
94 mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idD', '".$randomNR[$i]."', 'false')");
96 /* send out email, TODO: check for error with email */
98 "you are invited to play a game of DoKo (that is to debug the program ;).\n".
99 "Place comments and bug reports here:\n".
100 "http://wiki.nubati.net/index.php?title=EmailDoko\n\n".
101 "The whole round would consist of the following players:\n".
106 "If you want to join this game, please follow this link:\n\n".
109 mymail($EmailA,"You are invited to a game of DoKo","Hello $PlayerA,\n".$message.$hashA);
110 mymail($EmailB,"You are invited to a game of DoKo","Hello $PlayerB,\n".$message.$hashB);
111 mymail($EmailC,"You are invited to a game of DoKo","Hello $PlayerC,\n".$message.$hashC);
112 mymail($EmailD,"You are invited to a game of DoKo","Hello $PlayerD,\n".$message.$hashD);
115 echo "You started a new game. The emails have been sent out!";
117 /* end set up a new game */
119 else if(myisset("me"))
121 /* handle request from one specific player,
122 * the hash is set on a per game base
125 $me = $_REQUEST["me"];
127 /* test for valid ID */
128 $myid = DB_get_userid_by_hash($me);
131 echo "Can't find you in the database, please check the url.<br />\n";
132 echo "perhaps the game has been cancled, check by login in <a href=\"$host\">here</a>.";
136 DB_update_user_timestamp($myid);
138 /* get some information from the DB */
139 $gameid = DB_get_gameid_by_hash($me);
140 $myname = DB_get_name_by_hash($me);
141 $mystatus = DB_get_status_by_hash($me);
142 $mypos = DB_get_pos_by_hash($me);
144 if(myisset("cancle"))
145 echo "<p style=\"background-color:red\";>canceling a game is not implemented at the moment, but will be soon...<br /><br /></p>";
150 check_want_to_play($me);
151 DB_set_hand_status_by_hash($me,'init');
154 if( !myisset("in","update") )
156 DB_set_hand_status_by_hash($me,'start');
157 echo "you need to answer both question";
161 if($_REQUEST["in"] == "no")
163 $message = "Hello, \n\n".
164 "the game has been canceled due to the request of one of the players.\n";
166 $userids = DB_get_all_userid_by_gameid($gameid);
167 foreach($userids as $user)
169 $To = DB_get_email_by_userid($user);
170 mymail($To,"[DoKo] game cancled",$message);
173 /* delete everything from the dB */
178 echo "thanks for joining the game... please scroll down";
179 echo "TODO: make this page nicer<br />";
180 echo "TODO: set card pref<br />";
182 $mycards = DB_get_hand($me);
184 echo "<p class=\"mycards\">your cards are: <br />\n";
185 foreach($mycards as $card)
189 check_for_sickness($me,$mycards);
191 DB_set_hand_status_by_hash($me,'check');
197 echo "checking if you selected solo or nines...<br />".
198 " if you have a wedding, please send an email to the other players. <br />".
199 " if you have poverty you need to play a normal game,sorry...<br />".
200 " Please click <a href=\"$host?me=$me\">here</a> to finish the setup.<br />";
201 if(!myisset("solo","wedding","poverty","nines") )
203 /* all these variables have a pre-selected default,
204 * so we should never get here,
205 * unless a user tries to cheat ;) */
206 echo "something went wrong...please contact the admin.";
210 /* check if this sickness needs to be handled first */
211 $gametype = DB_get_gametype_by_gameid($gameid);
212 $startplayer = DB_get_startplayer_by_gameid($gameid);
214 if( $_REQUEST["solo"]!="No")
216 DB_set_solo_by_hash($me,$_REQUEST["solo"]);
217 DB_set_sickness_by_hash($me,"solo");
218 echo "<br />Seems like you want to play a ".$_REQUEST["solo"]." solo. Got it.<br />\n";
220 if($gametype == "solo" && $startplayer<$mypos)
224 /* this solo comes first */
225 DB_set_gametype_by_gameid($gameid,"solo");
226 DB_set_startplayer_by_gameid($gameid,$mypos);
227 DB_set_solo_by_gameid($gameid,$_REQUEST["solo"]);
230 else if($_REQUEST["wedding"] == "yes")
232 /* TODO: add silent solo somewhere*/
233 echo "wedding was chosen<br />\n";
234 DB_set_sickness_by_hash($me,"wedding");
236 else if($_REQUEST["poverty"] == "yes")
238 echo "poverty was chosen<br />\n";
239 DB_set_sickness_by_hash($me,"poverty");
241 else if($_REQUEST["nines"] == "yes")
243 echo "nines was chosen<br />\n";
244 DB_set_sickness_by_hash($me,"nines");
248 DB_set_hand_status_by_hash($me,'poverty');
250 /* check all players and set game to final result, e.g. solo, wedding, povert, redeal */
254 /* here we need to check if there is a solo or some other form of sickness.
255 * If so, which one counts
256 * set that one in the Game table, delete other ones form Hand table
257 * tell people about it.
259 echo "<br />checking if someone else selected solo or nines... wedding and poverty not handled at the moment<br />".
260 " Please click <a href=\"$host?me=$me\">here</a> to finish the setup.<br />";
262 /* only set this after all poverty, etc. are handeled*/
263 DB_set_hand_status_by_hash($me,'play');
265 /* check if the game can start */
266 $userids = DB_get_all_userid_by_gameid($gameid);
268 foreach($userids as $user)
269 if(DB_get_hand_status_by_userid_and_gameid($user,$gameid)!='play')
274 DB_set_game_status_by_gameid($gameid,'play');
276 /* check what kind of game we are playing */
277 $gametype = DB_get_gametype_by_gameid($gameid);
278 $startplayer = DB_get_startplayer_by_gameid($gameid);
282 /* check for nines */
283 foreach($userids as $user)
285 if(DB_get_sickness_by_userid_and_gameid($user,$gameid) == 'nines')
289 /* gamestatus == normal, => cancel game */
290 if($nines && $gamestatus == "normal")
292 /* TODO: set game type to nines to be able to keep statistics */
294 $message = "Hello, \n\n".
295 "the game has been cancled becausee someone has five or more nines.\n";
297 $userids = DB_get_all_userid_by_gameid($gameid);
298 foreach($userids as $user)
300 $To = DB_get_email_by_userid($user);
301 mymail($To,"[DoKo] game cancled",$message);
304 /* delete everything from the dB */
312 /* check players for poverty */
313 foreach($userids as $user)
315 if(DB_get_sickness_by_userid_and_gameid($user,$gameid) == 'poverty')
318 $name = DB_get_name_by_userid($user);
319 echo "$name has a Vorbehalt. <br />";
322 /* if gamestatus == normal, set poverty or dpovert (in case two people have poverty) */
326 /* check players for wedding */
327 foreach($userids as $user)
329 if(DB_get_sickness_by_userid_and_gameid($user,$gameid) == 'wedding')
332 $name = DB_get_name_by_userid($user);
333 echo "$name has a Vorbehalt. <br />" ;
337 /* if gamestatus == normal, set wedding */
344 /* both entries here, so that the tricks are visible for both.
345 * in case of 'play' there is a break later that skips the last part
348 /* figure out what kind of game we are playing,
349 * set the global variables $TRUMP,$DIAMONDS,$HEARTS,$CLUBS,$SPADES
353 $gametype = DB_get_gametype_by_gameid($gameid);
355 if($gametype=="solo")
357 $gametype = DB_get_solo_by_gameid($gameid);
358 $GT = $gametype." ".$GT;
363 set_gametype($gametype);
365 /* get some infos about the game */
366 $gamestatus = DB_get_game_status_by_gameid($gameid);
368 /* display useful things in divs */
370 /* display local time */
371 echo "<div class=\"time\">\n Local times:<table>";
373 $users = DB_get_all_userid_by_gameid($gameid);
374 foreach($users as $user)
376 $offset = DB_get_user_timezone($user);
377 $zone = return_timezone($offset);
378 date_default_timezone_set($zone);
379 $name = DB_get_name_by_userid($user);
381 echo "<tr> <td>$name</td> <td>".date("Y-m-d H:i:s")."</td></tr>\n";
383 echo "</table>\n</div>\n";
385 if($gamestatus != 'pre')
388 /* display links to the users status page */
389 $result = mysql_query("SELECT email,password from User WHERE id='$myid'" );
390 $r = mysql_fetch_array($result,MYSQL_NUM);
391 output_link_to_user_page($r[0],$r[1]);
395 /* end display useful things*/
397 /* has the game started? No, then just wait here...*/
398 if($gamestatus == 'pre')
400 echo "you need to wait for the others... <br />";
401 break; /* not sure this works... the idea is that you can
402 * only play a card after everyone is ready to play */
405 /* display the table and the names */
406 $result = mysql_query("SELECT User.fullname as name,".
407 " Hand.position as position ".
409 "LEFT JOIN User ON User.id=Hand.user_id ".
410 "WHERE Hand.game_id='".$gameid."' ".
411 "ORDER BY position ASC");
413 echo "<div class=\"table\">\n".
414 " <img src=\"pics/table.png\" alt=\"table\" />\n";
415 while($r = mysql_fetch_array($result,MYSQL_NUM))
420 echo " <span class=\"table".($pos-1)."\">$name</span>\n";
424 /* get everything relevant to display the tricks */
425 $result = mysql_query("SELECT Hand_Card.card_id as card,".
426 " Hand.position as position,".
427 " Play.sequence as sequence, ".
431 "LEFT JOIN Play ON Trick.id=Play.trick_id ".
432 "LEFT JOIN Hand_Card ON Play.hand_card_id=Hand_Card.id ".
433 "LEFT JOIN Hand ON Hand_Card.hand_id=Hand.id ".
434 "LEFT JOIN Comment ON Play.id=Comment.play_id ".
435 "WHERE Trick.game_id='".$gameid."' ".
436 "ORDER BY Trick.id,sequence ASC");
439 $lasttrick = DB_get_max_trickid($gameid);
441 $play = array(); /* needed to calculate winner later */
443 $pos = DB_get_startplayer_by_gameid($gameid)-1;
444 $firstcard = ""; /* first card in a trick */
446 echo "\n<ul class=\"tricks\">\n";
447 echo " <li> Hello $myname! History: </li>\n";
449 while($r = mysql_fetch_array($result,MYSQL_NUM))
456 /* save card to be able to find the winner of the trick later */
461 /* first card in a trick, output some html */
462 if($trick!=$lasttrick)
464 /* start of an old trick? */
465 echo " <li onclick=\"hl('$trickNR');\"><a href=\"#\">Trick $trickNR</a>\n".
466 " <div class=\"trick\" id=\"trick".$trickNR."\">\n".
467 " <img class=\"arrow\" src=\"pics/arrow".($pos-1).".png\" alt=\"table\" />\n";
469 else if($trick==$lasttrick)
471 /* start of a last trick? */
472 echo " <li onclick=\"hl('$trickNR');\"><a href=\"#\">Current Trick</a>\n".
473 " <div class=\"trick\" id=\"trick".$trickNR."\">\n".
474 " <img class=\"arrow\" src=\"pics/arrow".($pos-1).".png\" alt=\"table\" />\n";
477 /* remember first card, so that we are able to check, what cards can be played */
482 echo " <div class=\"card".($pos-1)."\">\n";
484 /* display comments */
486 echo " <span class=\"comment\">".$comment."</span>\n";
491 echo " </div>\n"; /* end div card */
497 echo " </div>\n </li>\n"; /* end div table, end li table */
501 if($seq!=4 && $trickNR>1)
502 echo " </div>\n </li>\n"; /* end div table, end li table */
506 /* whos turn is it? */
509 $winner = get_winner($play,$gametype); /* returns the position */
511 $firstcard = ""; /* new trick, no first card */
516 if($next==5) $next=1;
519 /* my turn?, display cards as links, ask for comments*/
520 if(DB_get_pos_by_hash($me) == $next)
525 /* do we want to play a card? */
526 if(myisset("card") && $myturn)
528 $card = $_REQUEST["card"];
529 $handid = DB_get_handid_by_hash($me);
531 /* check if we have card and that we haven't played it yet*/
532 /* set played in hand_card to true where hand_id and card_id*/
533 $result = mysql_query("SELECT id FROM Hand_Card WHERE played='false' and ".
534 "hand_id='$handid' AND card_id=".DB_quote_smart($card));
535 $r = mysql_fetch_array($result,MYSQL_NUM);
540 /* mark card as played */
541 mysql_query("UPDATE Hand_Card SET played='true' WHERE hand_id='$handid' AND card_id=".
542 DB_quote_smart($card));
544 /* get trick id or start new trick */
545 $a = DB_get_current_trickid($gameid);
549 $playid = DB_play_card($trickid,$handcardid,$sequence);
551 /* check for coment */
552 if(myisset("comment"))
554 DB_insert_comment($_REQUEST["comment"],$playid,$myid);
557 /* display played card */
558 echo "<div class=\"card\">";
559 echo " you played <br />";
563 /*check if we still have cards left, else set status to gameover */
564 if(sizeof(DB_get_hand($me))==0)
566 DB_set_hand_status_by_hash($me,'gameover');
567 $mystatus='gameover';
570 /* if all players are done, set game status to game over,
571 * get the points of the last trick and send out an email
574 $userids = DB_get_all_userid_by_gameid($gameid);
577 foreach($userids as $user)
578 if(DB_get_hand_status_by_userid_and_gameid($user,$gameid)!='gameover')
583 DB_set_game_status_by_gameid($gameid,"gameover");
584 /* get score for last trick
585 * all other tricks are handled a few lines further down*/
586 $play = DB_get_cards_by_trick($trickid);
587 $winner = get_winner($play,$gametype); /* returns the position */
588 /* get points of last trick and save it */
590 foreach($play as $card)
591 $points = $points + card_value($card);
592 $winnerid = DB_get_handid_by_gameid_and_position($gameid,$winner);
594 mysql_query("INSERT INTO Score VALUES (NULL, '$gameid', '$winnerid', '$points')");
596 echo "ERROR during scoring";
598 /* email all players */
599 $result = mysql_query("SELECT fullname, SUM(score) FROM Score".
600 " LEFT JOIN Hand ON Hand.id=hand_id".
601 " LEFT JOIN User ON Hand.user_id=User.id".
602 " WHERE Hand.game_id=$gameid".
603 " GROUP BY fullname" );
604 $message = "The game is over. Thanks for playing :)\n";
605 while( $r = mysql_fetch_array($result,MYSQL_NUM))
606 $message .= " FINAL SCORE: ".$r[0]." ".$r[1]."\n";
607 $message .= "\nIf your not in the list above your score is zero...\n";
608 foreach($userids as $user)
610 $To = DB_get_email_by_userid($user);
611 mymail($To,"[DoKo] game over",$message);
616 /* email next player */
617 if(DB_get_game_status_by_gameid($gameid)=='play')
621 $play = DB_get_cards_by_trick($trickid);
622 $winner = get_winner($play,$gametype); /* returns the position */
624 /* get points of last trick and save it, last trick is handled
625 * a few lines further up */
627 foreach($play as $card)
628 $points = $points + card_value($card);
630 $winnerid = DB_get_handid_by_gameid_and_position($gameid,$winner);
632 mysql_query("INSERT INTO Score VALUES (NULL, '$gameid', '$winnerid', '$points')");
634 echo "ERROR during scoring";
637 echo "DEBUG: $winner got $points <br />";
639 /* who is the next player? */
644 $next = DB_get_pos_by_hash($me)+1;
646 if($next==5) $next=1;
648 /* email next player */
649 $next_hash = DB_get_hash_from_game_and_pos($gameid,$next);
650 $email = DB_get_email_by_hash($next_hash);
652 $message = "It's your turn now.\n".
653 "Use this link to play a card: ".$host."?me=".$next_hash."\n\n" ;
654 mymail($email,"[DoKo-debug] a card has been played",$message);
657 echo "DEBUG:<a href=\"index.php?me=".DB_get_hash_from_game_and_pos($gameid,$next).
658 "\"> next player </a> <br />\n";
664 echo "can't find that card?! <br />\n";
667 else if(myisset("card") && !$myturn )
669 echo "please wait until it's your turn! <br />\n";
672 $mycards = DB_get_hand($me);
673 $mycards = mysort($mycards,$gametype);
674 echo "<div class=\"mycards\">\n";
676 if($myturn && !myisset("card"))
678 echo "Hello ".$myname.", it's your turn! <br />\n";
679 echo "Your cards are: <br />\n";
680 echo "<form action=\"index.php?me=$me\" method=\"post\">\n";
682 /* do we have to follow suite? */
684 if(have_suit($mycards,$firstcard))
687 foreach($mycards as $card)
689 if($followsuit && !same_type($card,$firstcard))
692 display_link_card($card);
695 echo "<br />\nA short comments:<input name=\"comment\" type=\"text\" size=\"30\" maxlength=\"50\" />\n";
696 echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
697 echo "<input type=\"submit\" value=\"move\" />\n";
700 else if($mystatus=='play')
702 echo "Your cards are: <br />\n";
703 foreach($mycards as $card)
708 /* check if we need to set status to 'gameover' is done during playing of the card */
709 if($mystatus=='play')
711 /* the following happens only when the gamestatus is 'gameover' */
712 /* check if game is over, display results */
713 if(DB_get_game_status_by_gameid($gameid)=='play')
715 echo "the game is over for you.. other people still need to play though";
719 echo "the game is over now...<br />\n";
721 $result = mysql_query("SELECT fullname, SUM(score) FROM Score".
722 " LEFT JOIN Hand ON Hand.id=hand_id".
723 " LEFT JOIN User ON Hand.user_id=User.id".
724 " WHERE Hand.game_id=$gameid".
725 " GROUP BY fullname" );
726 while( $r = mysql_fetch_array($result,MYSQL_NUM))
727 echo " FINAL SCORE: ".$r[0]." ".$r[1]."<br />";
729 /* suggest a new game with the same people in it, just rotated once */
730 $names = DB_get_all_names_by_gameid($gameid);
731 output_ask_for_new_game($names[1],$names[2],$names[3],$names[0],$gameid);
735 echo "error in testing the status";
739 /* user status page */
740 else if(myisset("email","password"))
742 /* test id and password, should really be done in one step */
743 $email = $_REQUEST["email"];
744 $password = $_REQUEST["password"];
746 if(strlen($password)!=32)
747 $password = md5($password);
750 $uid = DB_get_userid_by_email_and_password($email,$password);
756 $time = DB_get_user_timestamp($uid);
757 $unixtime =strtotime($time);
759 $offset = DB_get_user_timezone($uid);
760 $zone = return_timezone($offset);
761 date_default_timezone_set($zone);
763 echo "last login: ".date("r",$unixtime)."<br />";
765 DB_update_user_timestamp($uid);
767 echo "<p>these are the games you are playing in:<br />\n";
768 $result = mysql_query("SELECT Hand.hash,Hand.game_id,Game.mod_date from Hand".
769 " LEFT JOIN Game On Hand.game_id=Game.id".
770 " WHERE Hand.user_id='$uid' AND Game.status<>'gameover'" );
771 while( $r = mysql_fetch_array($result,MYSQL_NUM))
773 echo "<a href=\"".$host."?me=".$r[0]."\">game #".$r[1]." </a>";
774 if(time()-strtotime($r[2]) > 60*60*24*30)
775 echo " The game has been running for over a month. Do you want to cancel it? <a href=\"$host?cancle=1&me=".$r[0]."\">yes</a>";
781 echo "<p>and these are your games that are already done:<br />\n";
782 $result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status='gameover'" );
783 while( $r = mysql_fetch_array($result,MYSQL_NUM))
784 echo "<a href=\"".$host."?me=".$r[0]."\">game #".$r[1]." </a><br />";
787 $names = DB_get_all_names();
788 echo "<p>registered players:<br />\n";
789 foreach ($names as $name)
790 echo "$name <br />\n";
793 echo "<p>Want to start a new game? remember 4 names from the list above and visit ".
794 "<a href=\"".$host."?new\">this page.</a></p>";
798 echo "sorry email and password don't match <br />";
802 /* page for registration */
803 else if(myisset("register") )
807 /* new user wants to register */
808 else if(myisset("Rfullname","Remail","Rpassword","Rtimezone") )
811 if(DB_get_userid_by_name($_REQUEST["Rfullname"]))
813 echo "please chose another name<br />";
816 if(DB_get_userid_by_email($_REQUEST["Remail"]))
818 echo "this email address is already used ?!<br />";
823 $r=mysql_query("INSERT INTO User VALUES(NULL,".DB_quote_smart($_REQUEST["Rfullname"]).
824 ",".DB_quote_smart($_REQUEST["Remail"]).
825 ",".DB_quote_smart(md5($_REQUEST["Rpassword"])).
826 ",".DB_quote_smart($_REQUEST["Rtimezone"]).",NULL)");
829 echo " added you to the database";
831 echo " something went wrong";
834 /* default login page */