I have an SQL table on a database that I want to export into a CSV file. Now I googled arround a bit and I found some PHP code that worked fine. The problem is this, when I run the PHP code in a file on it's own, IE prompts me asking whether I want to Open or Save the file (which is what I want it to do). However, when I integrate the code into an existing PHP page that I have, it just dumps the text to the screen (which is what I want to avoid!). Is there anyway I can have IE force a download of a CSV file for Excel? I'll paste the code below so you can see...
<edit> No matter what code I use to try and force a download, I can't seem to get IE to stop displaying the data in the bowser and force a download! HELP! </edit>
Question
ECEGatorTuro
Hey there fellow Neowinians! :)
I have an SQL table on a database that I want to export into a CSV file. Now I googled arround a bit and I found some PHP code that worked fine. The problem is this, when I run the PHP code in a file on it's own, IE prompts me asking whether I want to Open or Save the file (which is what I want it to do). However, when I integrate the code into an existing PHP page that I have, it just dumps the text to the screen (which is what I want to avoid!). Is there anyway I can have IE force a download of a CSV file for Excel? I'll paste the code below so you can see...
<edit> No matter what code I use to try and force a download, I can't seem to get IE to stop displaying the data in the bowser and force a download! HELP! </edit>
Edited by ECEGatorTuroLink to comment
Share on other sites
0 answers to this question
Recommended Posts