View Full Version : creating static pages with php - why?

05-18-2011, 03:38 PM

I have just started a small project that I'm going to do in my spare time over the next couple of weeks(or longer!) and I'm wondering if any of you could offer some advice and help.

I have a number of items that I need to keep an eye on, their price fluctuates daily and I want to create a very simple site that shows current price and keeps a record of previous prices, I need this information to be easily readable.

As far as getting the data for the site I don't know yet if I can get this from a datafeed, rss or if I will have to scrape the information but basically I am going to be building my own personal and very small price comparison/tracking site.

I have been having a look around at some of the big sites to get an idea of where to start and I noticed on this site:


that the pages are all static.

I know this site isn't anything special to look at but it provides the data exactly how I would like mine to be shown with a comparison of the daily price and a graph tracking lowest daily price.

I am assuming that there is a server downloading the data, sifting through the information and recreating the entire website every few hours. Is there a benefit to doing it this way and creating the static pages?

Is there an easy way to display data in graph format with php?


05-18-2011, 03:50 PM
I doubt that website you provided a link to is using static pages. Those pages are likely built on the fly and just look static.

As for graphing, there is some capability in the GD library, but there are other more powerful graphing libraries out there (the good ones you have to pay for).

05-18-2011, 07:36 PM
Fumigator is correct.

Just because the site uses .html on its pages doesn't mean that the pages are static (although its possible they are doing hourly updates but unlikely).

Using a .html extension has an advantage in that it looks like static html. If you're a hacker and you see static html pages you're less likely to be looking for ways to inject stuff or abuse the site.

Using php, perl or any server side language in .html is possible by configuring .html in httpd.conf (apaches config file) and setting them as executables like .pl, .cgi, .php etc.

Even paypal have some .html pages, as does ebay, I've seen a few on yahoo and i can think of plenty of forums which do so too.

05-18-2011, 09:51 PM
You don't even have to name the files with html extensions. You can use Redirect in an .htaccess file to completely change the look of the URL, which is typically what is done when you see a URL looking like http://example.com/cameras/portable/entrylevel/prices.html. It likely redirects to something like http://example.com/prices.php?product=54321&cat=12345&attrib=98765.

05-18-2011, 10:49 PM
Or if you're like me, everything goes through /?query= ;)

It could be php, perl, ruby etc :D