Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    creating static pages with php - why?

    Hi,

    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:

    http://www.camerapricebuster.co.uk/

    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?

    Thanks

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    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).

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,441
    Thanks
    62
    Thanked 537 Times in 524 Posts
    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.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    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/...el/prices.html. It likely redirects to something like http://example.com/prices.php?produc...5&attrib=98765.

  • #5
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,441
    Thanks
    62
    Thanked 537 Times in 524 Posts
    Or if you're like me, everything goes through /?query=

    It could be php, perl, ruby etc
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

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