xionhack Posted April 15, 2009 Share Posted April 15, 2009 Hello. I have a website done in php. I want to have a hyperlink that when the user clicks on it will download a csv file that would be created in that moment. I've looked in different forums and in the php manual but havent been able to do it. Can somebody help? Thanks! Quote Link to comment Share on other sites More sharing options...
schilly Posted April 15, 2009 Share Posted April 15, 2009 csv of what? Quote Link to comment Share on other sites More sharing options...
xionhack Posted April 15, 2009 Author Share Posted April 15, 2009 It would be a csv brought from fields from the mysql database Quote Link to comment Share on other sites More sharing options...
schilly Posted April 15, 2009 Share Posted April 15, 2009 grab your data from the db, format how you want it and write it to a file then set the headers to download the file. file download example here: http://www.higherpass.com/php/Tutorials/File-Download-Security/ you should be able to do it without writing the data to a file but i can't remember how off hand. Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 15, 2009 Share Posted April 15, 2009 you should be able to do it without writing the data to a file but i can't remember how off hand. header implode echo should do the trick Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.