I am building a reporting application. The reports are dynamically created using PHP. I want to allow a user to view a report, and optionally save it on the web server. I would then store the name and location of the report file in a relational database, tied to the user's ID.
I'm not sure how to go about saving the web page on the server. The "save" button could run javascript that grabs document.body.innerHTML and posts the result to a server page, which could then use PHP to write the content to a file, but that doesn't seem like a great approach... among other things, all the <head> content would be lost.
Theoretically, I could save a copy of each report as it is created on the server, and then later on delete the ones that aren't saved by the user. I don't know how I would implement this in PHP though; the PHP content is only a subset of the actual report.
Many thanks for any advice on this.
mike
I'm not sure how to go about saving the web page on the server. The "save" button could run javascript that grabs document.body.innerHTML and posts the result to a server page, which could then use PHP to write the content to a file, but that doesn't seem like a great approach... among other things, all the <head> content would be lost.
Theoretically, I could save a copy of each report as it is created on the server, and then later on delete the ones that aren't saved by the user. I don't know how I would implement this in PHP though; the PHP content is only a subset of the actual report.
Many thanks for any advice on this.
mike