PHP Download Confirm Popup window script

/* openpdf.php */
$filename = $_REQUEST['filename'];
$filename_array = explode(".", $filename);
$filename_Extn=end($filename_array);

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");

$filename_Extn_Upper=strtoupper($filename_Extn);

if ($filename_Extn_Upper=='ZIP' || $filename_Extn_Upper=='zip')
{
header("Content-Type: application/zip");
}elseif($filename_Extn_Upper=='PDF' || $filename_Extn_Upper=='pdf')
{
header("Content-Type: application/pdf");
//}elseif($filename_Extn_Upper='HTM')
}else
{
header("Content-Type: text/html");
}

header("Content-Disposition: attachment; filename=".basename($filename).";" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
readfile("$filename");
?>

We can call the function in the following manner

Click here to download