diff options
author | arun <arun@nubati.net> | 2007-02-03 03:46:41 +0000 |
---|---|---|
committer | arun <arun> | 2007-02-03 03:46:41 +0000 |
commit | 686b0be45302319f7f30d38d129cee68ebfc12bf (patch) | |
tree | c617feeb1af31e3922e76755bfff5f6b425d10a5 | |
parent | 87619b20d23599acf4132d2f36555ffeda35f775 (diff) | |
download | e-DoKo-686b0be45302319f7f30d38d129cee68ebfc12bf.tar.gz e-DoKo-686b0be45302319f7f30d38d129cee68ebfc12bf.tar.bz2 e-DoKo-686b0be45302319f7f30d38d129cee68ebfc12bf.zip |
better selection of players for new game
-rw-r--r-- | index.php | 6 | ||||
-rw-r--r-- | output.php | 17 |
2 files changed, 15 insertions, 8 deletions
@@ -22,8 +22,10 @@ output_header(); /* check if we want to start a new game */ if(myisset("new")) - output_form_for_new_game(); - +{ + $names = DB_get_all_names(); + output_form_for_new_game($names); +} /*check if everything is ready to set up a new game */ else if( myisset("PlayerA", "PlayerB","PlayerC","PlayerD" )) { @@ -83,15 +83,20 @@ function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid) return; } -function output_form_for_new_game() +function output_form_for_new_game($names) { ?> - <p>Please add 4 names, please make sure that the names are correct! </p> + <p>Please select four players </p> <form action="index.php" method="post"> - Name: <input name="PlayerA" type="text" size="10" maxlength="20" /> - Name: <input name="PlayerB" type="text" size="10" maxlength="20" /> - Name: <input name="PlayerC" type="text" size="10" maxlength="20" /> - Name: <input name="PlayerD" type="text" size="10" maxlength="20" /> +<?php + foreach( array("PlayerA","PlayerB","PlayerC","PlayerD") as $player) + { + echo " Name: <select name=\"$player\" size=\"1\" /> \n"; + foreach($names as $name) + echo " <option>$name</option>\n"; + echo " </select>\n"; + } +?> <input type="submit" value="start game" /> </form> |