Hi all, I have a database with about 400 records where a number is they primary key. I need to convert each record into a separate HTML file and save it on the server.
For example (very basic), suppose my fields were ID, Name, Category, Desc.
ID, Name, Category, Desc
1,Fred,Admin,His name is Fred
399,Don,Co-op,His name is Don
Assuming I have all permissions, etc. correct on the server, is there a somewhat decent way to do this? I figure I can use fopen and fwrite's, however I'm a bit concerned with formatting. The HTML file will consist of a table to display the data and I'm a bit concerned with all of the special symbols inteferring with each other (" ' > <, etc).
My plan is to have a button on the "Add/Edit" backend page where I can click "Export Data" and it will run the code to do the above. The end product should be 400 HTML files - 1.html, 2.html, 3.html, etc. etc. (after clicking the button on each ID).
Thanks in advance for any ideas! It's been a solid year since I've done any hardcore PHP...Thanks again!
EDIT:
I should also point out I know how to export the data normally and I already have an HTML page that pulls the data from the database and populates correctly. I'm just trying to create a button that will essentially create and save the page permanently.
Also, everything is located on a remote server...I am unable to install anything or run anything on my local PC to do this. I'm needing something that is independent and can be run anywhere by any admin.
And yes, I know this sounds stupid. This is the best way for us to get a set of uniform static pages.
4TH EDIT:
I've been searching the forum for a while now and some ideas have sprung into my head. The main one...it would kind of be a pain, but would it be possible to create a "Preview button" that runs my current code, then have an "Export" button that would save the page? Is there a way to capture all of the HTML source from a page?