I’ve created a PHP file which shows the results from a MySQL database as we all create like in
echo "<table><tr><td>";
...
echo "</td></tr></table>";
But now I want to make a button at the bottom of the table, something like ‘save report’, which saves the created table into HTML format.
So how could it be done?
You can use the following scripts:
index.php
In index.php, you have the HTML table.
savefile.php
And then use the file savefile.php to popup your browser’s download dialog to save the file.