I am a novice programmer at PHP. I want to redirect my webpage to another webpage. The problem is that First I want to output a file as an attachment and then redirect the web page
I have used this code to output the attachment file
header("Content-Disposition: attachment; filename=$filename"); echo $out;
is the text I want to write in my attachment file.
Now Since I have used echo here I cant use
to redirect my webpage. I have also tried to use ob_start() and ob_end_flush() but then my file wont be outputted as an attachment. What should I do?