I have am having a problem with some coding on my website. What I want to do is for a user to click on a link to download a file from my server on to there computer. But once they click on the link I want them to be redirected to another screen saying if download don't start to click here.
But the problem that I am having is the download window comes up, but it don't redirect to the page saying click here.........
Here is the coding that I am using to out my pages:-
@header("HTTP/1.0 200 OK");
@header("HTTP/1.1 200 OK");
@header("Content-type: text/html");
@header("Cache-Control: no-cache, must-revalidate, max-age=0");
@header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
@header("Pragma: no-cache");
if(trim($output['download']) != '')
{
$this->download_output($output['download']);
}
$this->display['gzip'] = ob_get_contents();
ob_end_clean();
ob_start('ob_gzhandler');
}
print $this->display['output'];
$driver->end_mysql();
exit();
And here is coding that I am using to download the file, so any help will be greatly appreciated
function download_output($download)
{
header("Pragma:");
header('Content-Disposition: attachment; filename="' . $download['name'] .'"');
header('Content-Type: audio/mp3');
header("Content-length:".(string)(filesize($download['location'])));
readfile($download['location']);
header('Connection: close');
}
cap