Hi, I am trying to implement a poker game with checkboxes. Checkboxes are used to hold the dices in hand for second roll.
However, I am unable to extract the values of the boxes via $REQUEST[], or or $POST[] method. Here is the code extract
....
$keepIt[0]=$POST["keepIt[0]"];
$keepIt[1]=$POST["keepIt[1]"];
$keepIt[2]=$POST["keepIt[2]"];
$keepIt[3]=$POST["keepIt[3]"];
$keepIt[4]=$_POST["keepIt[4]"];
.....
for ($i = 0; $i<5; $i++){
if($keepIt[$i]==""){
$die[$i]=rand(1,6);
} else {
$die[$i] = $keepIt[$i];
}
//In this part, if it is a second roll no new random numbers should be assigned to die for each keepIt that is defined.
However, it seems that keepIts are undefined as each new roll creates 5 new dices no matter the checkboxes are selected.
.....
print <<<HERE
<input type = "checkbox"
name = "keepIt[$i]"
value="$die[$i]">
</td>
HERE;
....
Do you have any idea how i can fix this problem?