<html> <script> window.open("http://link.to/file", "Download page") location.href="http://ya.ru/"; </script> </html>
$file_name="test.txt"; header("Content-Length: ".filesize($file_name)); header("Content-Disposition: attachment; filename=".$file_name); header("Content-Type: application/x-force-download; name=\"".$file_name."\""); readfile($file_name);