Here is my page script:
<?php
session_start();
$_SESSION["square"]=$_SESSION["square"]+$_POST['roll'];
echo '<img src="images/dice.gif">';
?>
<?php sleep(10);?>
<?php
echo "You rolled a ".$_POST['roll']."!";
if ($_SESSION["square"]<100){
$url="board.php";
}
else
{
$url="finished.php";
}
echo '<META HTTP-EQUIV=Refresh CONTENT="2; URL='.$url.'">';
?>
The 'sleep' happens before the content of my page loads. I want the pause to happen before the dice roll result appears but after the gif is displayed.
Why is the pause occurring seemingly before it's called?
Roll again';break;case 'rolling_animation':echo '
Roll';break;}` – MonkeyZeus Jul 25 '16 at 13:32