現在我得到了這段代碼;如何在下載框出現時重定向頁面?
<?php
$file = "pain.png";
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
?>
此代碼出現在下載框中。但我想將此頁面重定向到「謝謝」頁面,而下載框仍在此處。我怎樣才能做到這一點?
謝謝...