Is it possible to generate a text file using text from a database and then make that file available for download? I have a client that wants to display their info. on a web site, as well as provide it in printable and downloadable forms.
You don’t have to do any of this. You can have PHP generate just about any type of content, and deliver it in any way a browser knows how. For example:
<? //Generate text file on the fly
header("Content-type: text/plain");
header("Content-Disposition: attachment; filename=savethis.txt");
// do your Db stuff here to get the content into $content
print "This is some text...\
";
print $content;
?>
Save that php script as text.php then in your html file,
<a href=“text.php”>Save this</a> - clicking on that link would cuase the save as dialog to pop up…
I’m a little alte to this question, but hopefully it’ll help someone in the future.