From 75ad669f06207b8e2813c7ae4f238d46dab25160 Mon Sep 17 00:00:00 2001 From: arun Date: Tue, 14 Nov 2006 20:00:18 +0000 Subject: Initial import --- index.php | 210 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 index.php (limited to 'index.php') diff --git a/index.php b/index.php new file mode 100644 index 0000000..90b91ce --- /dev/null +++ b/index.php @@ -0,0 +1,210 @@ + + + + Doko via email + + + +

Welcome to E-Doko

+ +"; + echo " player 1
"; + echo " player 2
"; + echo " player 3
"; + echo " player 4
"; + /* read in random.txt */ + if(file_exists("random.txt")) + $random = file("random.txt"); + else + die("no random file"); + + $randomNR = explode( ":", $random[1] ); + + /* write status into file */ + $output = fopen("status.txt","w"); + if ($output) + { + fwrite($output, "0\n"); + + fwrite($output, "hash1:".$PlayerA.":".$EmailA."::" ); + for($i=0;$i<12;$i++) + fwrite($output,";$randomNR[$i]" ); + fwrite($output,"\n"); + + fwrite($output, "hash2:$PlayerB:$EmailB::" ); + for(;$i<24;$i++) + fwrite($output,";$randomNR[$i]" ); + fwrite($output,"\n"); + + fwrite($output, "hash3:$PlayerC:$EmailC::" ); + for(;$i<36;$i++) + fwrite($output,";$randomNR[$i]" ); + fwrite($output,"\n"); + + fwrite($output, "hash4:$PlayerD:$EmailD::"); + for(;$i<48;$i++) + fwrite($output,";$randomNR[$i]" ); + fwrite($output,"\n"); + + fclose($output); + } + else + echo "can't open file for writing"; +}; + +/* test if a game is running, else output everything for a new game */ +if(sizeof($lines)<2) +{ +?> +

no game in progress, please input 4 names and email addresses

+
+ Name: + Email:
+ + Name: + Email:
+ + Name: + Email:
+ + Name: + Email:
+ + +
+ +
+ Do you want to play a game of DoKo? + yes + no
+ + Do you want to get an email for every card played or only if it your move? + every card + only on my turn
+\n"; + echo "\n"; + echo "\n"; + echo "
\n"; +} + /* yes? email him his hand, ask for solo, poverty, email every move or every card? */ +if(isset($_REQUEST["b"])) +{ + $b=$_REQUEST["b"]; + echo "hash is $b
"; + if(!isset($_REQUEST["in"])|| !isset($_REQUEST["update"]) ) + { + echo "go back to "; + echo " here and fill out the form
"; + } + else + { /* show the hand */ + echo $player[$b]["cards"]; + $tmp = $player[$b]["cards"]; + $cards = explode( ":",$tmp); + echo "your cards are"; + foreach($cards as $card) echo " $card "; + echo "
\n"; + ?> +
+ + do you want to play solo? + yes + no
+ + do you have a wedding? + yes + no
+ + do you have poverty? + yes + no
+ + + + + + +
+ + + + + -- cgit v1.2.3-18-g5258