Simple PHP file download / application page

advertisements

I'm looking for a simple PHP-based download or "request" script that works in a fashion of download.php?file=zip.php

Ideally the page would say "you are requesting .zip" then wait five seconds before downloading file. Is this possible?


Only because this is easy, I will write the codes but SO is not for that, just if you have a bugg with your previously-written code.

<?php
    $filename = $_GET["file"];
    if(isset($filename)){
        echo "You are downloading ".$filename;
        echo "<script type='text/javascript'>top.location='".$filename."';</script>";
    }else{
        echo "You havent selected a file to download";
    }
?>

Imagining the URL is download.php?file=hohoho.zip it would output:

You are downloading hohoho.zip
<script type='text/javascript'>top.location='hohoho.zip';</script>