Results 1 to 2 of 2

Thread: How is making a counter Descending

  1. #1
    Join Date
    Feb 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How is making a counter Descending

    1) Script Title:
    counter Descending
    2) Script URL (on DD):
    couldn't found it : http://www.dynamicdrive.com
    3) Describe problem:
    I'm searching for a script like counter Descending , and after Specified number of figures like 10.9.8.7.6.5.4.3.2.1 .. then Icon appear written on it DOWNLOAD
    when you click on it refer you to the download site.
    hope you understand me

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Something like this maybe?
    Code:
    <html>
    <head>
    <title><?php echo ($_GET['file']) ? "Download ".$_GET['file'] : "Downloader"; ?></title>
    <script type="text/javascript">
    function countDown(el,count){
    document.getElementById(el).innerHTML='<center><button onClick="void(0)" disabled="yes">'+count+' more seconds till download</button></center>';
    count -= 1;
    if(count != -1){
    setTimeout("countDown('"+el+"',"+count+")",1000);
    } else {
    document.getElementById(el).innerHTML='<center><button onClick="downloadFile(\'<?php  echo $_GET['file']; ?>\')">Click to download.</button></center>';
    }
    }
    function downloadFile(file){
    window.location=file;
    }
    </script>
    </head>
    <?php
    if($_GET['file']){
    if(file_exists($_GET['file'])){
    echo "
    <body onLoad=\"countDown('download',10)\">
    <div align='center'>
    File Name: <b>".$_GET['file']."</b> <br />
    File Size: <b>".filesize($_GET['file'])." bytes</b></br />
    File format: <b>".ucfirst(substr($_GET['file'],strlen($_GET['file'])-3))."</b></div><br />
    <span id='download'><center><noscript>If your seeing this message, please enable javascript</noscript></center></span>
    </body>
    ";
    } else {
    die('File doesn\'t exist');
    }
    } else {
    echo "<body><h1 align='center'>No file specified...</h2></body>";
    }
    ?>
    </html>
    Its not very secure though.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •