• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 133
  • Last Modified:

Database -> Html Output

So I have a products system and a cateogries system that need static pages created for each.  Now I'm wondering how one would go about managing of it (how to keep track of the static pages that were created, I was thinking by db) .

Please advise and give some solutions to this.  Also naming and why you'd name it that certain way.  Personally, I'd like it to be productname.extension not 01.extension.   So please factor that in.

Thank you.

1 Solution

You could have a script to manage your database entries. Then in the management pages, you could add a like that says "publish" or "generate static content".
The next php script would just simply read out the database and create the static pages for you.
You could then indeed create .html files which are called by productname rather than productid.

An alternative is to use mod_rewrite which allows you to match urls to scripts:
RewriteRule ^products/01/Red Eyed Dragon.html$ /product.php?producti1=01&productname=Red Eyed Dragon.

The above rule will make sure that when anybody goes to http://yourwebsite.com/products/01/Red Eyed Dragon.html they get the content generated by product.php.


Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now