How to use PHP to create downloadable CSV files for exporting data. Creating downloadable CSV files using PHP. To offer the file for download with the suggested. If the user manages to set the target to some kinda config-file (configuration.php in Joomla!), he will get a blank page - unless readfile() is used. Using include will just behave as a normal request (no output).
![]()
Active7 years, 5 months ago
This question already has an answer here:
I have a php function for getting info out of my database. When they go to http://example.com/test/download
I want to create a fake test.txt (text is dynamic) and download it. It's contents should be the equivalent of executing
foreach(databaseContent() as $content) { echo $content . '<br/>' } inside of it.
How can I get started on this? (Using php)
williumwillium
95655 gold badges1414 silver badges3131 bronze badges
marked as duplicate by Sven phpNov 19 '15 at 19:32
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Generate File To Download Php Installer1 Answer
You can link to a php document along these lines, which forces a download of type plain text. (Well, suggests to the browser that that should happen, at any rate.)
Of course, pass in appropriate post or get args, to control it the way you like.
david van brinkdavid van brink
Generate File To Download Php Software
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Php Generate Excel File![]() Not the answer you're looking for? Browse other questions tagged phpdatabasefiledownload or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |