Database -> Html Output

Posted on 2006-05-16
Last Modified: 2006-11-18
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.

Question by:lamerhooDJV
    1 Comment
    LVL 49

    Accepted 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 Eyed Dragon.html they get the content generated by product.php.


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now