I'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!
(written 2006-02-26, updated 2010-05-15)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
H102 - A First PHP Web Page [1448] Question on division (Java) - Also Perl, PHP, Python ... - (2007-11-28)
[2432] Using print_r in PHP to explore mysql database requests - (2009-10-01)
[3915] How does PHP work? - (2012-11-07)
[4074] A comment on comments in PHP - (2013-04-28)
H101 - Introduction to PHP [48] PHP - onwards and upwards - (2004-09-14)
[55] Evening classes to learn PHP - (2004-09-19)
[93] Case Sensitive? - (2004-10-19)
[124] PHP v Java - (2004-11-20)
[132] Portrait of the author - (2004-11-27)
[135] Too many Perls - (2004-11-30)
[317] Programming languages - a comparison - (2005-05-20)
[341] Happy Birthday, PHP - (2005-06-09)
[380] Bridging to the customer requirement - (2005-07-16)
[382] Central London Courses - Perl, PHP, Python, Tcl, MySQL - (2005-07-18)
[433] FTP - how to make the right transfers - (2005-09-01)
[577] Learning to program in Perl or PHP - (2006-01-26)
[629] Choosing the right language - (2006-03-01)
[646] PHP - London course, Melksham Course, Evening course - (2006-03-14)
[691] Testing you Perl / PHP / MySQL / Tcl knowledge - (2006-04-19)
[712] Why reinvent the wheel - (2006-05-06)
[789] Hot answers in PHP - (2006-07-02)
[795] Remember a site's non-technical issues too - (2006-07-07)
[846] Is Perl being replaced by PHP and Python? - (2006-08-27)
[917] Syntax checking in PHP - (2006-11-07)
[924] The LAMP Cookbook - Linux, Apache, MySQL, PHP / Perl - (2006-11-13)
[949] Sludge off the mountain, and Python and PHP - (2006-11-27)
[1050] The HTML++ Metalanguage - (2007-01-22)
[1198] From Web to Web 2 - (2007-05-21)
[1717] Q - Should I use Perl or Python? - (2008-07-23)
[1753] Perl v PHP, choosing the right language - (2008-08-14)
[1958] PHP - Parse error: syntax error, unexpected $end ... - (2008-12-23)
[2097] PHP Course - for hobby / club / charity users. - (2009-03-22)
[3025] Learning to Program ... in PHP. Course examples. - (2010-11-01)
[4118] We not only teach PHP and Python - we teach good PHP and Python Practice! - (2013-06-18)
[4621] The power of scripting - (2016-01-12)
Some other Articles
Active LearningJIT or JAUNot just a pretty face to answer the phone.February picturesIt's REALLY easy to add a little PHPBehind every face is a person and a storyQueues and barrel rolls in PerlAnd the staff put the icing on the cakeFamiliar names, close to homeIf its Sunday, it must be the Norland