Jump to content

Recommended Posts

Hey I originally posted this in php but apparently this is javascript... well here goes nothin:

I need help on finding a script that functions like this:
Please wait X seconds for download (for example x=15 seconds)
Please wait 14 seconds for download (and then a second later)
Please wait 13 seconds for download... (process keeps repeating)
Click here to download the file you requested (occurs at 0 seconds)

Does anyone know of a script like that one? I have seen many sites use it including megaupload.com and rapidshare.de. I am running a site with many downloads and the ones that are files over 3 megabytes must have a timer inorder to conserve bandwidth (and files over 5 megabytes download speed will be limited to 25kbps, but I have found a script on how to do that using php, but am still awaiting help on how to use it since its just a code snippet and i am a fresh to php). If you can give me a script that would function like the one above, it would be of a great help to me. Thanks a bunch. (I know how to hide the url of the download and force it to save using php so that isn't a problem).
Link to comment
https://forums.phpfreaks.com/topic/14799-please-wait-x-seconds-url-revealer/
Share on other sites

javascriptkit.com  simplythebest.net  <-- these have great javascript scripts.. what you need is a simple <span id=blah></span>  and document.getElementByID("blah").innerHTML= x  and set up a little timer to reduce x by so often then read from like TheFile.js?fileID=XX when x=0
try this
[code]
<body onload="show_time();">
<script language="javascript">
var seconds = 15
function show_time(){
if (seconds > 0){
if (seconds == 1) var s="";
else var s="s";

document.getElementById('url_msg').innerHTML = "Please wait "+seconds+" second"+s+" for download";
seconds--;
setTimeout("show_time()", 1000);
}
else {
document.getElementById('url_msg').innerHTML = "Please click here to download";
}
}
</script>
<div id="url_msg">

</div>
</body>
[/code]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.