the session after sending the form changes the number to another. Instead of the first one chosen by rand.
$correctNum = rand(1,5);
$_SESSION["correct"]=$correctNum;
if(!isset($correctNum)){
$correctNum = rand(1,5);
$_SESSION["correct"]=$correctNum;
}
if ($correctNum==|number from the form|){
echo "Win";
session_unset();
session_destroy();
}
My Answer:
'correctNum'] = $correctNum;
Rate this post
4 of 5 based on 8434 votesComments