Hi. I'm hoping someone can help me with this problem and maybe give me an alternative solution.
I have a website where users can extract data that is in a mysql table and it is saved on the server in a comma-deliminated text file. So on the server i may have a file like this:
/upload/FILE1.txt
What is the best way to have that remote user access the file as a text file. Right now i am using this code:$fp = fopen(
$fp = fopen("$directory_path", "r");
while (!feof($fp)) {
$show_file = fgets($fp, 100);
echo $show_file."<br>";
Which displays the file on an html page. The user can then use cut and paste to save the data on his own machine in a text file.
The problem is when a record is too long the html page adds a return and kinda screws up the order of the data: Example:
1,firstname,lastname,address,city,state,zipcode
the above might get printed as:
1,firstname,lastname,address,ci
ty,state,zipcode
Hope this made any kind of sense... thanks for any reply