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 08:06:20)
Associated topics are indexed under
H101 - Introduction to PHP [2097] PHP Course - for hobby / club / charity users. - (2009-03-22)
[1958] PHP - Parse error: syntax error, unexpected $end ... - (2008-12-23)
[1753] Perl v PHP, choosing the right language - (2008-08-14)
[1717] Q - Should I use Perl or Python? - (2008-07-23)
[1198] From Web to Web 2 - (2007-05-21)
[1050] The HTML++ Metalanguage - (2007-01-22)
[949] Sludge off the mountain, and Python and PHP - (2006-11-27)
[924] The LAMP Cookbook - Linux, Apache, MySQL, PHP / Perl - (2006-11-13)
[917] Syntax checking in PHP - (2006-11-07)
[846] Is Perl being replaced by PHP and Python? - (2006-08-27)
[795] Remember a site's non-technical issues too - (2006-07-07)
[789] Hot answers in PHP - (2006-07-02)
[712] Why reinvent the wheel - (2006-05-06)
[691] Testing you Perl / PHP / MySQL / Tcl knowledge - (2006-04-19)
[646] PHP - London course, Melksham Course, Evening course - (2006-03-14)
[629] Choosing the right language - (2006-03-01)
[577] Learning to program in Perl or PHP - (2006-01-26)
[433] FTP - how to make the right transfers - (2005-09-01)
[382] Central London Courses - Perl, PHP, Python, Tcl, MySQL - (2005-07-18)
[380] Bridging to the customer requirement - (2005-07-16)
[341] Happy Birthday, PHP - (2005-06-09)
[317] Programming languages - a comparison - (2005-05-20)
[135] Too many Perls - (2004-11-30)
[132] Portrait of the author - (2004-11-27)
[124] PHP v Java - (2004-11-20)
[93] Case Sensitive? - (2004-10-19)
[55] Evening classes to learn PHP - (2004-09-19)
[48] PHP - onwards and upwards - (2004-09-14)
H102 - A First PHP Web Page [2432] Using print_r in PHP to explore mysql database requests - (2009-10-01)
[1448] Question on division (Java) - Also Perl, PHP, Python ... - (2007-11-28)
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