I was back for first principles this morning for a delegate who - though very much an experienced programmer - is new to web work and HTML, and I put together a series of demonstrations using various web components ...
1. A straightforward HTML page, including document definition, a head and a body section, all carefully formed using Transitional XHTML. In separate windows -
run the code and
view source
2. Adding in some server side programming - in the form of PHP - to make the XHTML sent to the browser change depending on a calculation. The calculation of our example is simply to work out the date and time (including day of the week) and include them in the page. In separate windows -
run the code and
view source
3. For regular reporting and monitoring applications, you'll want a web page that's regularly updated - and the next step was for us to add in a refresh capability so that the page is updated automatically once a minute. In separate windows -
run the code and
view source
4. So far, our web page looks fairly basic - but it can look far smarter if we apply style / cascading style sheets, which we did in the next example. In separate windows -
run the code and
view source
5. A picture paints a thousand words, so let's add a graphic (.jpg) to our web page. In separate windows -
run the code and
view source
6. Finally, we used a Javascript program running in the browser to resize the image to fit the width of the window, and to resize it again if our user resizes the window once the page has loaded too. In separate windows -
run the code and
view source
There you are, then - XHTML, Server side programming (PHP), Client pull refresh, Style sheets (CSS), Images (JPG) and client side programming (Javascript) all in the one example - a mini "HOWTO" showing you how the various elements can be used together.
(written 2008-08-11)
Associated topics are indexed under
W504 - Web and Intranet - Not Just Text [3133] An image from a website that occasionally comes out as hyroglyphics - (2011-01-14)
[2554] Adding retrospective ALT attributes to IMG - (2009-12-28)
[1806] Dealing with overhead cables in a photograph - (2008-09-21)
[1618] A small picture does not always cut it! - (2008-04-21)
[847] Image maps for navigation - a straightforward example - (2006-08-28)
[665] PHP Image viewing application - (2006-04-01)
[553] Keep that image small - (2006-01-03)
[351] Is photoajustment an addiction? - (2005-06-18)
W602 - Web and Intranet - Client Side Technologies [3128] How does your browser find out about itself? - (2011-01-11)
[2628] An example of an injection attack using Javascript - (2010-02-08)
[2390] Dynamic / changing images on your web page - (2009-09-01)
[1814] Javascript/HTML example, dynamic server monitor - (2008-09-28)
[1813] Ajax - going Asyncronous and what it means - (2008-09-28)
[1812] Starting Ajax - easy example of browser calling up server data - (2008-09-27)
[1681] Adding a button to a web page to print the page - (2008-06-18)
[1322] Flash - is it available to your web page? - (2007-08-26)
[522] Javascript events - a good example - (2005-12-09)
[411] Javascript examples (some PHP and MySQL too) - (2005-08-13)
W603 - Web and Intranet - Server Side Technologies [2282] Checking robots.txt from Python - (2009-07-12)
[2055] Effect on server when memory runs out and swapping starts - (2009-02-26)
[1615] PHP training courses every month - (2008-04-18)
[1554] Online hotel reservations - Melksham, Wiltshire (near Bath) - (2008-02-24)
[1365] Korn Shell scripts on the web - (2007-09-25)
[1355] .php or .html extension? Morally Static Pages - (2007-09-17)
[1031] robots.txt - a clue to hidden pages? - (2007-01-13)
[1020] Parallel processing in PHP - (2007-01-03)
[732] Where is a web site visitor browsing from - (2006-05-24)
[653] Easy feed! - (2006-03-21)
[642] How similar are two words - (2006-03-11)
Some other Articles
Perl v PHP, choosing the right languageDynamic maps / geographics in PHPPublic Training Course Dates until July 2009Glorious (?) 12th August - what a Pe(a)rl!Using server side and client side programming togetherHotel room prices - Melksham, WiltshireWho is watching you?London for the visitor, for freeMoodle, Drupal, Django (and Rails)Lua examples, Lua Courses