summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/index.php b/index.php
index 989a547..83c8cb7 100644
--- a/index.php
+++ b/index.php
@@ -109,10 +109,11 @@ if(myisset("new"))
$game_id = mysql_insert_id();
/* create hash */
- $hashA = md5("AGameOfDoko".$game_id.$PlayerA.$EmailA);
- $hashB = md5("AGameOfDoko".$game_id.$PlayerB.$EmailB);
- $hashC = md5("AGameOfDoko".$game_id.$PlayerC.$EmailC);
- $hashD = md5("AGameOfDoko".$game_id.$PlayerD.$EmailD);
+ $TIME = (string) time(); /* to avoid collisions */
+ $hashA = md5("AGameOfDoko".$game_id.$PlayerA.$EmailA.$TIME);
+ $hashB = md5("AGameOfDoko".$game_id.$PlayerB.$EmailB.$TIME);
+ $hashC = md5("AGameOfDoko".$game_id.$PlayerC.$EmailC.$TIME);
+ $hashD = md5("AGameOfDoko".$game_id.$PlayerD.$EmailD.$TIME);
/* create hands */
mysql_query("INSERT INTO Hand VALUES (NULL,".DB_quote_smart($game_id).",".DB_quote_smart($useridA).