HTML vs PHP

Discussion in 'HTML & Website Design' started by buckmajor, Sep 15, 2009.

  1. #1
    Hi there

    I know PHP has an advantage over HTML, since I've been using it for some time now but mainly for my template if the site needs a lot of pages :D.

    I was wondering when it was unnecessary to build your site in php? For example if I had to build a 1-5 page site, is it better to use plain html? Its been a while now, but would appreciate if you have other opinions.

    Many thanks in advance
    CHEERS :)
     
    buckmajor, Sep 15, 2009 IP
  2. Design_Guy

    Design_Guy Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If your website is 1-5pages of static content or the owner of the content knows how to update the content using HTML, then HTML/CSS is a good option.

    Personally even for a 5 page website I would create a very simple CMS using PHP includes so I can change the layout of all five pages just by updating one PHP file.

    If I was to create a website for a client, that does not know how to code HTML, they would be much better off having a full CMS so they can easily update their website themselves.
     
    Design_Guy, Sep 15, 2009 IP
  3. jamesicus

    jamesicus Peon

    Messages:
    477
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Web pages are documents composed using HTML Markup -- PHP is a Server-side scripting language that performs document delivery and processing tasks. PHP cannot be used exclusively to produce a Web page -- Markup (HTML/ XHTML et al) is required to produce a document that will render in User-Agents (including graphical Browsers) while PHP is a scripting language that can be employed to manipulate document rendering.

    Here is an example of a page (validated XHTML 1.0 and CSS 2.1) that uses PHP on the server side to serve it via content-negotiation as MIME type application/xhtml+xml or text/html according to Browser rendering capabilities.

    James
     
    jamesicus, Sep 15, 2009 IP
  4. jeff_oneil

    jeff_oneil Peon

    Messages:
    29
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If it's static content that will never change you can go ahead and use only HTML...
     
    jeff_oneil, Sep 15, 2009 IP
  5. DOCtriN

    DOCtriN Well-Known Member

    Messages:
    184
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    103
    #5
    If you don't do a lot of changes in appearance and content, it's easier and faster if you use HTML + CSS
     
    DOCtriN, Sep 15, 2009 IP
  6. Design_Guy

    Design_Guy Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I find using some simple PHP includes is just as fast and as easy, with the added benefit of saving time in the future if you decide to update the layout etc..
     
    Design_Guy, Sep 15, 2009 IP
  7. jamesicus

    jamesicus Peon

    Messages:
    477
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Web pages are always changing (always under construction). I use HTML- CSS - RDF/XML (with very little server side or client side scripting) to compose most of my pages whose content changes/is updated daily. I write my own content management routines.

    James
     
    jamesicus, Sep 15, 2009 IP
  8. jonbuoy

    jonbuoy Peon

    Messages:
    284
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I always use a php include for my page header, footer and menus. It's so much faster to make general changes to all pages, even for a site with only a handful of pages.
     
    jonbuoy, Sep 16, 2009 IP
  9. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #9
    I tend to use PHP for everything, just incase I need to do something fancy in the future.

    Most of the sites I design for clients have "directory" urls (e.g domain.com/something/) for each page, so it doesn't really matter what extension I use anyway. And I usually use PHP to include a header and menu.

    PHP FTW MF LOL :D
     
    Kerosene, Sep 16, 2009 IP
  10. buckmajor

    buckmajor Active Member

    Messages:
    574
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #10
    Thanks guys for the comment, I needed to know when and why to use PHP, but yea everyone has a very good point.
     
    buckmajor, Sep 18, 2009 IP