I have a page that echo's 10 questions so the user can choose one, what I want is a one second delay between each question being displayed, I have tried sleep() in the loop but this doesn't work
My current code is
for($i=0; $i < 10; $i++) {
sleep(1);
echo "<tr><td style='text-align:center;'>$i</td>
<td colspan=9>";
?><input type="button" value="<?php echo $rows[$_SESSION['questions'][$i]]["question"]; ?>"
onclick="location.href='game/update.php?gameID=<?php echo $player['current_game_id']."&gamequestion=".$rows[$_SESSION['questions'][$i]]["question_no"]."&runs=$runs"; ?>'"><?php
echo "</td></tr>";
}
NOTE that if I take sleep(1) out everything works fine but when I put it in it only gives a ten second delay after I have clicked a button that appears from in the loop.