I want my script to act like a flat file. That is, let's say you click a link for download.php. The browser then asks to download a file...say text.txt. The file is dynamically generated by the script.
I know that you can use the content-type header (probably with a text/plain mime type) to make the browser download the file. What I can't figure out is how to make the browser see the download as a different filename.
What would I do?
header('Content-type: text/plain');
[i]what code to output the file contents?
what code to emulate the filename as text.txt?[/i]
Thanks for any help. 🙂