Quantcast
Channel: PHP – WPULTI: Web Design Magazine, Tutorials, Themes, Inspiration
Viewing all articles
Browse latest Browse all 31

How to Allow Downloading in 3 Seconds With PHP

$
0
0

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=http://example.com?value=download");
// show this message
echo "You can download in 3 seconds.";

}

The post How to Allow Downloading in 3 Seconds With PHP appeared first on WPULTI: Web Design Magazine, Tutorials, Themes, Inspiration.


Viewing all articles
Browse latest Browse all 31

Trending Articles