Here's what I want to do:
A user clicks a link to download some text (from a PHP file)
That PHP file generates the text, and dumps the content. The user is then prompted to download the file.
Code: Select all
<?PHP
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=test.txt");
echo "Contents of file";
?>