"Your download should begin in 5 seconds"

Everything that doesn't belong to any other forum but this one. If it doesn't belong here then it ... well, it just doesn't.

Moderator: mkoch227

Post Reply
waffle

"Your download should begin in 5 seconds"

Post 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
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Guest

Post 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>
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
waffle

thank you!

Post by waffle »

thanks muchly!

-Kevin
Post Reply