My problem is two-fold here. I've got a script which takes a string created by a SQL query and turns it into a .txt file. Problem is, I don't know how to use the header() function to make the file call for the prompt to save (i.e. I think it should be "content-type: application/octet-stream", but I don't know where to put the header in the .php or .phtml page to make that happen), instead of just pushing the .txt file to appear in the browser.
The other problem I'm having is that I want to somehow set an expiration date on these files I'm creating so that, at the end of the day they were created, they expire and unlink themselves automatically, OR have a script run that checks the expiration date, and deletes them that way.
Any help will be appreciated.