Add title to webpage from database
I have a table in my database that has a page title, keywords, images and other content for every page. I want to write some code in PHP and MySQL to fetch that data and create the file that is an HTML or PHP file (by fetching the file name stored in table) and write the code开发者_开发百科 to fetch the page title and other content for page into the file one by one for each row, so that if later on I want to increase one column in any page, I may able to do so by increasing one field or table only.
Why write out files when you can just have one page that examines the URL to determine what data from the database to use when returning the HTML?
You can see that StackOverflow has hundreds of thousands of question and answer webpages, but there is only one file serving all these pages. They are not saving a file for every question onto a hard drive.
精彩评论