Hi, I have this script that downloads a file. Next, I would like an automatic redirect to an other page. The problem is that my redirect command somehow is not read but added to the downloaded file ! Any way to prevent this ??
thanks in advance for your help !
here is my script:
[code=php]$name=’file.txt’;
$add=’http://www.mysite.com/’.$name;
$gogo=”Content-Disposition: attachment; filename=”.$name;
$content_len=@filesize($add);
Header(“Content-type: application/txt”);
Header(“Content-type: octet-stream”);
Header($gogo);
if($content_len!=FALSE)
{
Header(“Content-length: $content_len”);
}
readfile($add);
//the next echo is the problem … it is added to the file!
echo “<script>window.location.href=’mynextpage.php’;</script>”;