I’ve used the replace bit of the header (
header("Content-disposition: attachment; filename=help.txt;", 0);
and
header("Content-disposition: attachment; filename=help.txt;", false);
) and have even tried creating the files using fopen (but that way is ugly).
I’ve scanned the net but did not find anything of use and I’m sure someone has done this before and it really is a piece of cake.
Someone take pity on someone new to PHP and web design and give me an answer to my problem.
Below is my (edited) code at the moment.
Code: Select all
if (isset($_POST["cb_helpfile"]))
{
header("Content-disposition: attachment; filename=help.txt;",);
header("Content-Type:text/plain", 0);
output_file("help", "HelpIntroduction.txt"); // function to print out the to the text file
output_file("help", "HelpControlPanel.txt");
output_file("help", "HelpOutlook.txt");
}
if (isset($_POST["cb_tender"]))
{
header("Content-disposition: attachment; filename=tender.txt;");
// THIS IS WHERE IT GOES WRONG
header("Content-Type:text/plain");
output_file("tender", "TenderFrontPage.txt");
output_file("tender", "TenderIntroduction.txt");
}