You need to mix up PHP & Javascript for this
First PHP
Send headers, so that page will navigate to the download page .
header( "refresh:30;url=download.php" );
echo 'The download will begin in 30 secs. If not, click <a href="download.php">here</a>.';
Then Javascript
This handles the part where we show time to the user, so that he know.
var count=30; //30 seconds
var counter = setInterval(timer(),1000); //1000 will run it every 1 second
function timer()
{
count=count-1;
if (count <= 0)
{
clearInterval(counter);
return;
}
document.getElementById("placetoshowtime").innerHTML = count; //display the time to user
}
Small demo of JS Part.
When, the java script finishes ticking, the PHP will already have redirected to download page. So it creates the illusion you are after.