How to generate static html page with PHP?
Hi,
I am working on my new website in PHP.
I am not sure how to create a static HTML webpage in PHP for the most recent 15 topics. I mean I want a mechanism that can generate static HTML pages & show the top/recent 15 topics. I have seen this on many sites.I just want to know how to create a static html page in PHP? I want to reduce the server load.
Thanks in advance.
Re: How to generate static html page with PHP?
Hi,
You need to write some simple PHP scripts, you can prepare a CRON & have it automatically update your website at specific time intervals. You can use the CRON job to query the Database that will go in the static page. The databse query is what you need. USe the PHP file function to create a new file & then parse the database result into your desired form say XML.
I hope this helps.
Re: How to generate static html page with PHP?
When you are running a large volume website that requires alot of mysql_query action you'll probably want to consider ways to reduce the impact of your server's performance. Always go for static HTML pages because, our visitors get pages which load real fast, your hosting bill goes down and server is now able to handle more queries without choking and static HTML pages whose contents keep changing matters more.
Static HTML Generation With PHP
When you are running a large volume website that requires alot of mysql_query action you'll probably want to consider ways to reduce the impact of your server's performance. We can do this by generating static html pages from the pages that require all of these queries. By writing a few simple PHP scripts you can prepare to CRON your PHP driven site and have it automatically update for you at set intervals. Or you can have direct control over the updates via your web browser. This makes your website run alot faster and reduces your MySQL database queries dramatically.
Re: How to generate static html page with PHP?
Hey guys Thanks for the prompt reply.
I will definitely have a look at your guidelines. Ill post & bug you if I find any problem generating such static html pages. Well said Corona, Search engine loves static pages more since they keep on updating the data.
Thanks again.