cornholio27 Posted April 10, 2008 Share Posted April 10, 2008 I have a newsletter sign up box on my site, which adds the emails address to my mysql database. I would like to be able to log in to the protected area of the site and have a link to download the email list as a text file, which is formatted ready to copy and paste in an email. Any help/suggestions would be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/100451-download-mysql-column-into-text-file/ Share on other sites More sharing options...
Lumio Posted April 10, 2008 Share Posted April 10, 2008 Whats your problem? Where do you need help? Link to comment https://forums.phpfreaks.com/topic/100451-download-mysql-column-into-text-file/#findComment-513693 Share on other sites More sharing options...
cornholio27 Posted April 10, 2008 Author Share Posted April 10, 2008 Sorry, I wasn't clear enough. My problem is the php/mysql code to collect the info and create a text file to a location of the user's choice. So, they click the link and are presented with a download dialog allowing them to save the generated text file. Link to comment https://forums.phpfreaks.com/topic/100451-download-mysql-column-into-text-file/#findComment-513698 Share on other sites More sharing options...
Lumio Posted April 10, 2008 Share Posted April 10, 2008 Okay Now I'm understanding... You only have to change the headers: <?php header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="file.txt"'); echo "Here you can output some text" ?> Link to comment https://forums.phpfreaks.com/topic/100451-download-mysql-column-into-text-file/#findComment-513873 Share on other sites More sharing options...
cornholio27 Posted April 11, 2008 Author Share Posted April 11, 2008 Brilliant. Thanks very much for your help Link to comment https://forums.phpfreaks.com/topic/100451-download-mysql-column-into-text-file/#findComment-514552 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.