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 . 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
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.
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
If you don't do a lot of changes in appearance and content, it's easier and faster if you use HTML + CSS
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..
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
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.
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
Thanks guys for the comment, I needed to know when and why to use PHP, but yea everyone has a very good point.