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 */
12 /* check if some variables are set in the config file, else set defaults */
13 if(!isset($EmailName))
19 echo "Working on the database...please check back in a few mintues";
27 /* check if we want to start a new game */
30 $names = DB_get_all_names();
31 output_form_for_new_game($names);
33 /*check if everything is ready to set up a new game */
34 else if( myisset("PlayerA", "PlayerB","PlayerC","PlayerD" ))
36 $PlayerA = $_REQUEST["PlayerA"];
37 $PlayerB = $_REQUEST["PlayerB"];
38 $PlayerC = $_REQUEST["PlayerC"];
39 $PlayerD = $_REQUEST["PlayerD"];
41 $EmailA = DB_get_email_by_name($PlayerA);
42 $EmailB = DB_get_email_by_name($PlayerB);
43 $EmailC = DB_get_email_by_name($PlayerC);
44 $EmailD = DB_get_email_by_name($PlayerD);
46 if($EmailA=="" || $EmailB=="" || $EmailC=="" || $EmailD=="")
48 echo "couldn't find one of the names, please start a new game";
52 $useridA = DB_get_userid_by_name($PlayerA);
53 $useridB = DB_get_userid_by_name($PlayerB);
54 $useridC = DB_get_userid_by_name($PlayerC);
55 $useridD = DB_get_userid_by_name($PlayerD);
57 /* create random numbers */
58 $randomNR = create_array_of_random_numbers();
59 $randomNRstring = join(":",$randomNR);
63 if(myisset("followup") )
65 $followup= $_REQUEST["followup"];
66 mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,'1','pre','$followup' ,NULL)");
69 mysql_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,'1','pre', NULL ,NULL)");
70 $game_id = mysql_insert_id();
73 $hashA = md5("AGameOfDoko".$game_id.$PlayerA.$EmailA);
74 $hashB = md5("AGameOfDoko".$game_id.$PlayerB.$EmailB);
75 $hashC = md5("AGameOfDoko".$game_id.$PlayerC.$EmailC);
76 $hashD = md5("AGameOfDoko".$game_id.$PlayerD.$EmailD);
79 mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridA).
80 ", ".DB_quote_smart($hashA).", 'start','1',NULL,NULL,NULL,'false','false',NULL)");
81 $hand_idA = mysql_insert_id();
82 mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridB).
83 ", ".DB_quote_smart($hashB).", 'start','2',NULL,NULL,NULL,'false','false',NULL)");
84 $hand_idB = mysql_insert_id();
85 mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridC).
86 ", ".DB_quote_smart($hashC).", 'start','3',NULL,NULL,NULL,'false','false',NULL)");
87 $hand_idC = mysql_insert_id();
88 mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridD).
89 ", ".DB_quote_smart($hashD).", 'start','4',NULL,NULL,NULL,'false','false',NULL)");
90 $hand_idD = mysql_insert_id();
94 mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idA', '".$randomNR[$i]."', 'false')");
96 mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idB', '".$randomNR[$i]."', 'false')");
98 mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idC', '".$randomNR[$i]."', 'false')");
100 mysql_query("INSERT INTO Hand_Card VALUES (NULL, '$hand_idD', '".$randomNR[$i]."', 'false')");
102 /* send out email, TODO: check for error with email */
104 "you are invited to play a game of DoKo (that is to debug the program ;).\n".
105 "Place comments and bug reports here:\n".
106 "http://wiki.nubati.net/index.php?title=EmailDoko\n\n".
107 "The whole round would consist of the following players:\n".
112 "If you want to join this game, please follow this link:\n\n".
115 mymail($EmailA,"You are invited to a game of DoKo","Hello $PlayerA,\n".$message.$hashA);
116 mymail($EmailB,"You are invited to a game of DoKo","Hello $PlayerB,\n".$message.$hashB);
117 mymail($EmailC,"You are invited to a game of DoKo","Hello $PlayerC,\n".$message.$hashC);
118 mymail($EmailD,"You are invited to a game of DoKo","Hello $PlayerD,\n".$message.$hashD);
121 echo "You started a new game. The emails have been sent out!";
123 /* end set up a new game */
125 else if(myisset("me"))
127 /* handle request from one specific player,
128 * the hash is set on a per game base
131 $me = $_REQUEST["me"];
133 /* test for valid ID */
134 $myid = DB_get_userid_by_hash($me);
137 echo "Can't find you in the database, please check the url.<br />\n";
138 echo "perhaps the game has been cancled, check by login in <a href=\"$host\">here</a>.";
142 DB_update_user_timestamp($myid);
144 /* get some information from the DB */
145 $gameid = DB_get_gameid_by_hash($me);
146 $myname = DB_get_name_by_hash($me);
147 $mystatus = DB_get_status_by_hash($me);
148 $mypos = DB_get_pos_by_hash($me);
150 echo "<p class=\"gamenumber\"> Game $gameid </p>\n";
154 if(myisset("cancle"))
155 echo "<p style=\"background-color:red\";>canceling a game is not implemented at the moment, but will be soon...<br /><br /></p>";
160 check_want_to_play($me);
161 DB_set_hand_status_by_hash($me,'init');
164 if( !myisset("in","update") )
166 DB_set_hand_status_by_hash($me,'start');
167 echo "you need to answer both question";
171 if($_REQUEST["in"] == "no")
173 $message = "Hello, \n\n".
174 "the game has been canceled due to the request of one of the players.\n";
176 $userids = DB_get_all_userid_by_gameid($gameid);
177 foreach($userids as $user)
179 $To = DB_get_email_by_userid($user);
180 mymail($To,$EmailName."game cancled",$message);
183 /* delete everything from the dB */
188 echo "thanks for joining the game... please scroll down";
189 echo "TODO: make this page nicer<br />";
190 echo "TODO: set card pref<br />";
192 $mycards = DB_get_hand($me);
194 echo "<p class=\"mycards\">your cards are: <br />\n";
195 foreach($mycards as $card)
199 check_for_sickness($me,$mycards);
201 DB_set_hand_status_by_hash($me,'check');
207 echo "checking if you selected solo or nines...<br />".
208 " if you have a wedding, please send an email to the other players. <br />".
209 " if you have poverty you need to play a normal game,sorry...<br />".
210 " Please click <a href=\"$host?me=$me\">here</a> to finish the setup.<br />";
211 if(!myisset("solo","wedding","poverty","nines") )
213 /* all these variables have a pre-selected default,
214 * so we should never get here,
215 * unless a user tries to cheat ;) */
216 echo "something went wrong...please contact the admin.";
220 /* check if this sickness needs to be handled first */
221 $gametype = DB_get_gametype_by_gameid($gameid);
222 $startplayer = DB_get_startplayer_by_gameid($gameid);
224 if( $_REQUEST["solo"]!="No")
226 DB_set_solo_by_hash($me,$_REQUEST["solo"]);
227 DB_set_sickness_by_hash($me,"solo");
228 echo "<br />Seems like you want to play a ".$_REQUEST["solo"]." solo. Got it.<br />\n";
230 if($gametype == "solo" && $startplayer<$mypos)
234 /* this solo comes first */
235 DB_set_gametype_by_gameid($gameid,"solo");
236 DB_set_startplayer_by_gameid($gameid,$mypos);
237 DB_set_solo_by_gameid($gameid,$_REQUEST["solo"]);
240 else if($_REQUEST["wedding"] == "yes")
242 /* TODO: add silent solo somewhere*/
243 echo "wedding was chosen<br />\n";
244 DB_set_sickness_by_hash($me,"wedding");
246 else if($_REQUEST["poverty"] == "yes")
248 echo "poverty was chosen<br />\n";
249 DB_set_sickness_by_hash($me,"poverty");
251 else if($_REQUEST["nines"] == "yes")
253 echo "nines was chosen<br />\n";
254 DB_set_sickness_by_hash($me,"nines");
258 DB_set_hand_status_by_hash($me,'poverty');
260 /* check all players and set game to final result, e.g. solo, wedding, povert, redeal */
264 /* here we need to check if there is a solo or some other form of sickness.
265 * If so, which one counts
266 * set that one in the Game table, delete other ones form Hand table
267 * tell people about it.
269 echo "<br />checking if someone else selected solo or nines... wedding and poverty not handled at the moment<br />".
270 " Please click <a href=\"$host?me=$me\">here</a> to finish the setup.<br />";
272 /* only set this after all poverty, etc. are handeled*/
273 DB_set_hand_status_by_hash($me,'play');
275 /* check if the game can start */
276 $userids = DB_get_all_userid_by_gameid($gameid);
278 foreach($userids as $user)
279 if(DB_get_hand_status_by_userid_and_gameid($user,$gameid)!='play')
284 DB_set_game_status_by_gameid($gameid,'play');
286 /* check what kind of game we are playing */
287 $gametype = DB_get_gametype_by_gameid($gameid);
288 $startplayer = DB_get_startplayer_by_gameid($gameid);
292 /* check for nines */
293 foreach($userids as $user)
295 if(DB_get_sickness_by_userid_and_gameid($user,$gameid) == 'nines')
299 /* gamestatus == normal, => cancel game */
300 if($nines && $gamestatus == "normal")
302 /* TODO: set game type to nines to be able to keep statistics */
304 $message = "Hello, \n\n".
305 "the game has been cancled becausee someone has five or more nines.\n";
307 $userids = DB_get_all_userid_by_gameid($gameid);
308 foreach($userids as $user)
310 $To = DB_get_email_by_userid($user);
311 mymail($To,$EmailName."game cancled",$message);
314 /* delete everything from the dB */
322 /* check players for poverty */
323 foreach($userids as $user)
325 if(DB_get_sickness_by_userid_and_gameid($user,$gameid) == 'poverty')
328 $name = DB_get_name_by_userid($user);
329 echo "$name has a Vorbehalt. <br />";
332 /* if gamestatus == normal, set poverty or dpovert (in case two people have poverty) */
336 /* check players for wedding */
337 foreach($userids as $user)
339 if(DB_get_sickness_by_userid_and_gameid($user,$gameid) == 'wedding')
342 $name = DB_get_name_by_userid($user);
343 echo "$name has a Vorbehalt. <br />" ;
347 /* if gamestatus == normal, set wedding */
354 /* both entries here, so that the tricks are visible for both.
355 * in case of 'play' there is a break later that skips the last part
358 /* figure out what kind of game we are playing,
359 * set the global variables $TRUMP,$DIAMONDS,$HEARTS,$CLUBS,$SPADES
363 $gametype = DB_get_gametype_by_gameid($gameid);
365 if($gametype=="solo")
367 $gametype = DB_get_solo_by_gameid($gameid);
368 $GT = $gametype." ".$GT;
373 set_gametype($gametype);
375 /* get some infos about the game */
376 $gamestatus = DB_get_game_status_by_gameid($gameid);
378 /* display useful things in divs */
380 /* display local time */
381 echo "<div class=\"time\">\n Local times:<table>";
383 $users = DB_get_all_userid_by_gameid($gameid);
384 foreach($users as $user)
386 $offset = DB_get_user_timezone($user);
387 $zone = return_timezone($offset);
388 date_default_timezone_set($zone);
389 $name = DB_get_name_by_userid($user);
391 echo "<tr> <td>$name</td> <td>".date("Y-m-d H:i:s")."</td></tr>\n";
393 echo "</table>\n</div>\n";
395 if($gamestatus != 'pre')
398 /* display links to the users status page */
399 $result = mysql_query("SELECT email,password from User WHERE id='$myid'" );
400 $r = mysql_fetch_array($result,MYSQL_NUM);
401 output_link_to_user_page($r[0],$r[1]);
405 /* end display useful things*/
407 /* has the game started? No, then just wait here...*/
408 if($gamestatus == 'pre')
410 echo "you need to wait for the others... <br />";
411 break; /* not sure this works... the idea is that you can
412 * only play a card after everyone is ready to play */
415 /* display the table and the names */
416 $result = mysql_query("SELECT User.fullname as name,".
417 " Hand.position as position ".
419 "LEFT JOIN User ON User.id=Hand.user_id ".
420 "WHERE Hand.game_id='".$gameid."' ".
421 "ORDER BY position ASC");
423 echo "<div class=\"table\">\n".
424 " <img src=\"pics/table.png\" alt=\"table\" />\n";
425 while($r = mysql_fetch_array($result,MYSQL_NUM))
430 echo " <span class=\"table".($pos-1)."\">$name</span>\n";
434 /* get everything relevant to display the tricks */
435 $result = mysql_query("SELECT Hand_Card.card_id as card,".
436 " Hand.position as position,".
437 " Play.sequence as sequence, ".
441 "LEFT JOIN Play ON Trick.id=Play.trick_id ".
442 "LEFT JOIN Hand_Card ON Play.hand_card_id=Hand_Card.id ".
443 "LEFT JOIN Hand ON Hand_Card.hand_id=Hand.id ".
444 "LEFT JOIN Comment ON Play.id=Comment.play_id ".
445 "WHERE Trick.game_id='".$gameid."' ".
446 "ORDER BY Trick.id,sequence ASC");
449 $lasttrick = DB_get_max_trickid($gameid);
451 $play = array(); /* needed to calculate winner later */
453 $pos = DB_get_startplayer_by_gameid($gameid)-1;
454 $firstcard = ""; /* first card in a trick */
456 echo "\n<ul class=\"tricks\">\n";
457 echo " <li> Hello $myname! History: </li>\n";
459 while($r = mysql_fetch_array($result,MYSQL_NUM))
466 /* save card to be able to find the winner of the trick later */
471 /* first card in a trick, output some html */
472 if($trick!=$lasttrick)
474 /* start of an old trick? */
475 echo " <li onclick=\"hl('$trickNR');\"><a href=\"#\">Trick $trickNR</a>\n".
476 " <div class=\"trick\" id=\"trick".$trickNR."\">\n".
477 " <img class=\"arrow\" src=\"pics/arrow".($pos-1).".png\" alt=\"table\" />\n";
479 else if($trick==$lasttrick)
481 /* start of a last trick? */
482 echo " <li onclick=\"hl('$trickNR');\"><a href=\"#\">Current Trick</a>\n".
483 " <div class=\"trick\" id=\"trick".$trickNR."\">\n".
484 " <img class=\"arrow\" src=\"pics/arrow".($pos-1).".png\" alt=\"table\" />\n";
487 /* remember first card, so that we are able to check, what cards can be played */
492 echo " <div class=\"card".($pos-1)."\">\n";
494 /* display comments */
496 echo " <span class=\"comment\">".$comment."</span>\n";
501 echo " </div>\n"; /* end div card */
507 echo " </div>\n </li>\n"; /* end div table, end li table */
511 if($seq!=4 && $trickNR>1)
512 echo " </div>\n </li>\n"; /* end div table, end li table */
516 /* whos turn is it? */
519 $winner = get_winner($play,$gametype); /* returns the position */
521 $firstcard = ""; /* new trick, no first card */
526 if($next==5) $next=1;
529 /* my turn?, display cards as links, ask for comments*/
530 if(DB_get_pos_by_hash($me) == $next)
535 /* do we want to play a card? */
536 if(myisset("card") && $myturn)
538 $card = $_REQUEST["card"];
539 $handid = DB_get_handid_by_hash($me);
541 /* check if we have card and that we haven't played it yet*/
542 /* set played in hand_card to true where hand_id and card_id*/
543 $result = mysql_query("SELECT id FROM Hand_Card WHERE played='false' and ".
544 "hand_id='$handid' AND card_id=".DB_quote_smart($card));
545 $r = mysql_fetch_array($result,MYSQL_NUM);
550 /* mark card as played */
551 mysql_query("UPDATE Hand_Card SET played='true' WHERE hand_id='$handid' AND card_id=".
552 DB_quote_smart($card));
554 /* get trick id or start new trick */
555 $a = DB_get_current_trickid($gameid);
559 $playid = DB_play_card($trickid,$handcardid,$sequence);
561 /* check for coment */
562 if(myisset("comment"))
564 DB_insert_comment($_REQUEST["comment"],$playid,$myid);
567 /* display played card */
568 echo "<div class=\"card\">";
569 echo " you played <br />";
573 /*check if we still have cards left, else set status to gameover */
574 if(sizeof(DB_get_hand($me))==0)
576 DB_set_hand_status_by_hash($me,'gameover');
577 $mystatus='gameover';
580 /* if all players are done, set game status to game over,
581 * get the points of the last trick and send out an email
584 $userids = DB_get_all_userid_by_gameid($gameid);
587 foreach($userids as $user)
588 if(DB_get_hand_status_by_userid_and_gameid($user,$gameid)!='gameover')
593 DB_set_game_status_by_gameid($gameid,"gameover");
594 /* get score for last trick
595 * all other tricks are handled a few lines further down*/
596 $play = DB_get_cards_by_trick($trickid);
597 $winner = get_winner($play,$gametype); /* returns the position */
598 /* get points of last trick and save it */
600 foreach($play as $card)
601 $points = $points + card_value($card);
602 $winnerid = DB_get_handid_by_gameid_and_position($gameid,$winner);
604 mysql_query("INSERT INTO Score VALUES (NULL, '$gameid', '$winnerid', '$points')");
606 echo "ERROR during scoring";
608 /* email all players */
609 $result = mysql_query("SELECT fullname, SUM(score) FROM Score".
610 " LEFT JOIN Hand ON Hand.id=hand_id".
611 " LEFT JOIN User ON Hand.user_id=User.id".
612 " WHERE Hand.game_id=$gameid".
613 " GROUP BY fullname" );
614 $message = "The game is over. Thanks for playing :)\n";
615 while( $r = mysql_fetch_array($result,MYSQL_NUM))
616 $message .= " FINAL SCORE: ".$r[0]." ".$r[1]."\n";
617 $message .= "\nIf your not in the list above your score is zero...\n";
618 foreach($userids as $user)
620 $To = DB_get_email_by_userid($user);
621 mymail($To,$EmailName."game over",$message);
626 /* email next player */
627 if(DB_get_game_status_by_gameid($gameid)=='play')
631 $play = DB_get_cards_by_trick($trickid);
632 $winner = get_winner($play,$gametype); /* returns the position */
634 /* get points of last trick and save it, last trick is handled
635 * a few lines further up */
637 foreach($play as $card)
638 $points = $points + card_value($card);
640 $winnerid = DB_get_handid_by_gameid_and_position($gameid,$winner);
642 mysql_query("INSERT INTO Score VALUES (NULL, '$gameid', '$winnerid', '$points')");
644 echo "ERROR during scoring";
647 echo "DEBUG: $winner got $points <br />";
649 /* who is the next player? */
654 $next = DB_get_pos_by_hash($me)+1;
656 if($next==5) $next=1;
658 /* email next player */
659 $next_hash = DB_get_hash_from_game_and_pos($gameid,$next);
660 $email = DB_get_email_by_hash($next_hash);
662 $message = "It's your turn now.\n".
663 "Use this link to play a card: ".$host."?me=".$next_hash."\n\n" ;
664 mymail($email,$EmailName."a card has been played",$message);
667 echo "DEBUG:<a href=\"index.php?me=".DB_get_hash_from_game_and_pos($gameid,$next).
668 "\"> next player </a> <br />\n";
674 echo "can't find that card?! <br />\n";
677 else if(myisset("card") && !$myturn )
679 echo "please wait until it's your turn! <br />\n";
682 $mycards = DB_get_hand($me);
683 $mycards = mysort($mycards,$gametype);
684 echo "<div class=\"mycards\">\n";
686 if($myturn && !myisset("card"))
688 echo "Hello ".$myname.", it's your turn! <br />\n";
689 echo "Your cards are: <br />\n";
690 echo "<form action=\"index.php?me=$me\" method=\"post\">\n";
692 /* do we have to follow suite? */
694 if(have_suit($mycards,$firstcard))
697 foreach($mycards as $card)
699 if($followsuit && !same_type($card,$firstcard))
702 display_link_card($card);
705 echo "<br />\nA short comments:<input name=\"comment\" type=\"text\" size=\"30\" maxlength=\"50\" />\n";
706 echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
707 echo "<input type=\"submit\" value=\"move\" />\n";
710 else if($mystatus=='play')
712 echo "Your cards are: <br />\n";
713 foreach($mycards as $card)
718 /* check if we need to set status to 'gameover' is done during playing of the card */
719 if($mystatus=='play')
721 /* the following happens only when the gamestatus is 'gameover' */
722 /* check if game is over, display results */
723 if(DB_get_game_status_by_gameid($gameid)=='play')
725 echo "the game is over for you.. other people still need to play though";
729 echo "the game is over now...<br />\n";
731 $result = mysql_query("SELECT fullname, SUM(score) FROM Score".
732 " LEFT JOIN Hand ON Hand.id=hand_id".
733 " LEFT JOIN User ON Hand.user_id=User.id".
734 " WHERE Hand.game_id=$gameid".
735 " GROUP BY fullname" );
736 while( $r = mysql_fetch_array($result,MYSQL_NUM))
737 echo " FINAL SCORE: ".$r[0]." ".$r[1]."<br />";
739 /* suggest a new game with the same people in it, just rotated once */
740 $names = DB_get_all_names_by_gameid($gameid);
741 output_ask_for_new_game($names[1],$names[2],$names[3],$names[0],$gameid);
745 echo "error in testing the status";
749 /* user status page */
750 else if(myisset("email","password"))
752 /* test id and password, should really be done in one step */
753 $email = $_REQUEST["email"];
754 $password = $_REQUEST["password"];
756 if(strlen($password)!=32)
757 $password = md5($password);
760 $uid = DB_get_userid_by_email_and_password($email,$password);
766 $time = DB_get_user_timestamp($uid);
767 $unixtime =strtotime($time);
769 $offset = DB_get_user_timezone($uid);
770 $zone = return_timezone($offset);
771 date_default_timezone_set($zone);
773 echo "last login: ".date("r",$unixtime)."<br />";
775 DB_update_user_timestamp($uid);
777 echo "<p>these are the games you are playing in:<br />\n";
778 $result = mysql_query("SELECT Hand.hash,Hand.game_id,Game.mod_date from Hand".
779 " LEFT JOIN Game On Hand.game_id=Game.id".
780 " WHERE Hand.user_id='$uid' AND Game.status<>'gameover'" );
781 while( $r = mysql_fetch_array($result,MYSQL_NUM))
783 echo "<a href=\"".$host."?me=".$r[0]."\">game #".$r[1]." </a>";
784 if(time()-strtotime($r[2]) > 60*60*24*30)
785 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>";
791 echo "<p>and these are your games that are already done:<br />\n";
792 $result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status='gameover'" );
793 while( $r = mysql_fetch_array($result,MYSQL_NUM))
794 echo "<a href=\"".$host."?me=".$r[0]."\">game #".$r[1]." </a><br />";
797 $names = DB_get_all_names();
798 echo "<p>registered players:<br />\n";
799 foreach ($names as $name)
800 echo "$name <br />\n";
803 echo "<p>Want to start a new game? remember 4 names from the list above and visit ".
804 "<a href=\"".$host."?new\">this page.</a></p>";
808 echo "sorry email and password don't match <br />";
812 /* page for registration */
813 else if(myisset("register") )
817 /* new user wants to register */
818 else if(myisset("Rfullname","Remail","Rpassword","Rtimezone") )
821 if(DB_get_userid_by_name($_REQUEST["Rfullname"]))
823 echo "please chose another name<br />";
826 if(DB_get_userid_by_email($_REQUEST["Remail"]))
828 echo "this email address is already used ?!<br />";
833 $r=mysql_query("INSERT INTO User VALUES(NULL,".DB_quote_smart($_REQUEST["Rfullname"]).
834 ",".DB_quote_smart($_REQUEST["Remail"]).
835 ",".DB_quote_smart(md5($_REQUEST["Rpassword"])).
836 ",".DB_quote_smart($_REQUEST["Rtimezone"]).",NULL)");
839 echo " added you to the database";
841 echo " something went wrong";
844 /* default login page */