Page 1 of 1

"Your download should begin in 5 seconds"

Posted: Sat Aug 06, 2005 8:21 am
by waffle
Is the script available that implements the "Starting download...Your download should begin in 5 seconds" page, then pushes the file? That's much nicer than just sending the file when someone clicks a download link.

Thanks

Posted: Sat Aug 06, 2005 10:12 am
by Klemen
Hi,

Well, that's a quite complicated script actually (with MySQL database, download count, ...) but here's a simple version:

http://www.phpjunkyard.com/extras/simple_download.zip

It's quite easy to use. Open it in a plain text editor (Notepad, Wordpad) and add your own download links like this (you will see this in the code):

Code: Select all

$download['link1'] = 'http://www.yourdomain.com/download1.zip';
$download['link2'] = 'http://www.yourdomain.com/download2.zip';
$download['link3'] = 'http://www.yourdomain.com/download3.zip';
$download['link4'] = 'http://www.yourdomain.com/download4.zip';
Save and upload to the server. Then just link to the download.php like this:

http://www.yourdomain.com/download.php?file=link1
http://www.yourdomain.com/download.php?file=link2
http://www.yourdomain.com/download.php?file=link3
etc.

Enjoy :D

Posted: Sat Aug 06, 2005 10:29 am
by Guest
maybe even a simple meta refresh tag

link to the new page not directly to the downlaodable file,
although some browsers or even newer os dont always obey it.

<html>
<head>
<title>PleaseWait</title>
<meta http-equiv="refresh" content="5;url=yourfile.zip">
</head>
<body>
<p>Please Wait , your download will begin in 5 seconds:</p>
<p>If the download does not begin automatically, please click <a href="yourfile.zip" target="_blank">here</a></p>
</body>
</html>

Posted: Sat Aug 06, 2005 11:38 am
by Klemen
Yes, that's exactly what the above simple script does, except it can be used for multiple files using ?file=link1 so you don't have to create a different redirect page for each one.

True about some browsers/OS not obeying
<meta http-equiv="refresh" content="5;url=yourfile.zip">
That's why a direct link to the file ("click here") is also included.

Regards

thank you!

Posted: Mon Aug 08, 2005 12:38 am
by waffle
thanks muchly!

-Kevin