It's REALLY easy to add a little PHP
Archive - Originally posted on "The Horse's Mouth" - 2006-02-26 08:06:20 - Graham EllisI've taken to describing PHP and an "HTML++" language when I'm training. That's to show absolute newcomers to PHP that they can simple write a page of HTML, give it an extension such as .php, and it will function in exactly the way it always has for them.
Then, very gently, the newcomer can add in some extra tags - the "++" that I talk about in the "HTML++" of the language. These extra tags are recognised by the web server, so there's nothing at all special required by the user's browser.
I've put a demonstration of four really simple "one-liners" in PHP together to accompany this item. They are:
1. Including the date on your page (look - it's up to date)
2. Using an image that changes automatically every so often
3. Bringing in a "Message of the day" from a text file
4. Having a page include its own URL (very useful if people print the page!)
You can run the demonstration here and you'll find that I've added a fifth one-liner that lets you see the source code too - that means that you can use any of my techniques on your page. Please feel free to do so - although I would appreciate a link back to http://www.wellho.net
You may not even need to change the file extension to use PHP - if you look after your own web server, or if you're got an ISP who allows it, you may be able to add the following:
AddType application/x-httpd-php .html
to a file called .htaccess in your document directory and all pages will then have the HTML++ capabilities!