How to Allow Downloading in 3 Seconds With PHP

x theme
(Last Updated On: July 10, 2014)

Following is a script that will allow downloading in 3 seconds with PHP. The script will take a parameter, let’s say, “value=download“.

We’ll use header for refreshing after 3 seconds. If the value of the parameter will be “download“, it will echo the message “Downloading” else it will start download in 3 seconds.

In the script, we just have used “echo” to display message. But you can put extra stuff.

// if name via get equals 'download", show the downloading message.
if($_GET['value'] == "download"){

echo "Downloading ... ";

} else {
// set refresh to 3 seconds, make the variable name be 'download' via the get method;
header("Refresh: 3: url=");
// show this message
echo "You can download in 3 seconds.";


About the author


Leave a Reply

Your email address will not be published. Required fields are marked *