www.webdeveloper.com
Results 1 to 2 of 2

Thread: create a new html page using a mysql content management and php

Hybrid View

  1. #1
    Join Date
    Jan 2013
    Posts
    1

    create a new html page using a mysql content management and php

    Hello

    I am creating a content management system that will hold products, the admin will be able to add new products, however when a new product is added a new page on the website will need to be created displaying that products information. Is it possible to add a new item to the database and use php to make sure that every time a new product is created a new html page will be created? If that makes any sense?

    Thank you

  2. #2
    Join Date
    Oct 2012
    Posts
    42
    The most efficient way to handle this would be to use a product template page which is then populated with the specific product information from the database.

    The template page would contain the basic HTML structure of your product page, but with blanks/placeholders where the actual product information would be. You'd link to the page using something like

    product.php?productid=666

    where 666 is the product id within the database. This would load, querying the database for the data for product 666. The page would then insert the product information into the blanks in the template, displaying a product page for the required product.

    This would allow you to use one physical template file to display all your products.

    (You can use htaccess files and URL rewriting to allow for URLs which are friendlier both for your users and search engines, mapping the URL

    blah.com/products/666 (this is the URL your users / search engines sees)

    to

    blah.com/product.php?product_id=666 (this is the URL which the web server processes)

    Search for 'php template engines' and 'url rewriting' for further information.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles