A very busy week so far ... station pickups,
a PHP course, hosting an external luncheon meeting and
hotel guests at Well House Manor, and providing a venue for, and attending, a meeting of the presidents of some of the local chambers of commerce to discuss towns working together. And it's only just the end on Tuesday. Wednesday will bring ... well, you'll read some of it here.
On Monday, I "tunnelled" through PHP, producing a piece of code that worked for a benign user who put in sensible data. It coughed slightly with 'silly' values - it was obvious it had failed, and it looked really crappy - but it wasn't actually an injection attack risk. ("No - It's not nice - I will NOT publish it here"). And on Tuesday morning, I took that code and I said
DESIGN MATTERS - for the user, and for the maintenance programmer ... and I came up with the following list which I chose to implement to a lesser or greater extent - at least to an illustrative degree:
1. Code should be commented for programmer
2. Page should include instructions for the user
3. Forms should include a submit button, even if they only have a single input box which submits on "enter"
4. Code should echo user inputs
5. First page should not perform submission actions on nothing
6. Fields should usually be sticky
7. Data should be validated
8. Data should be secure against injection attacks
9. Common code should be grouped into functions
10. Generated HTML should conform to selected standard (XHTML?)
11. Program and design elements should be separated
12. Error messages should be good 'uns
You see - it's not JUST about making the algorithms accessible and workable - it's much MUCH more. Come to think of it ... as I write this note, I see that there are a few more things I should have done / documented. Some have been done already - second nature - others aren't actually present in my demo.
13. Help window
14. Search Engine Optimisation
15. Make it interesting
16. Should look good and be corporate branded!
17. Should provide support contact
18. Should provide links back to the calling ap / rest of site
Have a look at
the running application. Have a look at
the source code. See if you can work out which of those extras I have done something towards, and which are on my potential "to do" list.
There's a huge difference between a PHP script and a good web based application!
(written 2009-09-29 23:46:20)
Associated topics are indexed under
H050 - PHP - General [2663] Improve your PHP on a weekend away - (2010-03-05)
[2589] Your PHP code does not work? Here is where to start looking. - (2010-01-18)
[2559] Moving the product forward - ours, and MySQL, Perl, PHP and Python too - (2010-01-01)
[2504] Learning to program in ... - (2009-11-15)
[2400] Are you wanting to learn PHP? - (2009-09-08)
[2227] Learning PHP, Ruby, Lua and Python - upcoming courses - (2009-06-11)
[2222] A (biased?) comparison of PHP courses in the UK - (2009-06-07)
[2097] PHP Course - for hobby / club / charity users. - (2009-03-22)
[1722] PHP examples - source code and try it out too - (2008-07-26)
[235] Preparation for a day's work - (2005-03-04)
[116] The next generation of programmer - (2004-11-13)
H115 - Designing PHP-Based Solutions: Best Practice [2679] How to build a test harness into your PHP - (2010-03-16)
[2221] Adding a newsfeed for your users to a multipage PHP application - (2009-06-06)
[2199] Improving the structure of your early PHP programs - (2009-05-25)
[1794] Refactoring - a PHP demo becomes a production page - (2008-09-12)
[1694] Defensive coding techniques in PHP? - (2008-07-02)
[1623] PHP Techniques - a workshop - (2008-04-26)
[1533] Short and sweet and sticky - PHP form input - (2008-02-06)
[1490] Software to record day to day events and keep an action list - (2007-12-31)
[1487] Efficient PHP applications - framework and example - (2007-12-28)
[1482] A story about benchmarking PHP - (2007-12-23)
[1391] Ordnance Survey Grid Reference to Latitude / Longitude - (2007-10-14)
[1390] Converting from postal address to latitude / longitude - (2007-10-13)
[1389] Controlling and labelling Google maps via PHP - (2007-10-13)
[1381] Using a MySQL database to control mod_rewrite via PHP - (2007-10-06)
[1323] Easy handling of errors in PHP - (2007-08-27)
[1321] Resetting session based tests in PHP - (2007-08-26)
[1194] Drawing hands on a clock face - PHP - (2007-05-19)
[1182] Painting a masterpiece in PHP - (2007-05-10)
[1181] Good Programming practise - where to initialise variables - (2007-05-09)
[1166] Back button - ensuring order are not submitted twice (PHP) - (2007-04-28)
[1052] Learning to write secure, maintainable PHP - (2007-01-25)
[1047] Maintainable code - some positive advice - (2007-01-21)
[945] Code quality counts - (2006-11-26)
[936] Global, Superglobal, Session variables - scope and persistance in PHP - (2006-11-21)
[896] PHP - good coding practise and sticky radio buttons - (2006-10-17)
[839] Reporting on the 10 largest files or 10 top scores - (2006-08-20)
[572] Giving the researcher power over database analysis - (2006-01-22)
[563] Merging pictures using PHP and GD - (2006-01-13)
[426] Robust checking of data entered by users - (2005-08-27)
[394] A year on - should we offer certified PHP courses - (2005-07-28)
[340] Code and code maintainance efficiency - (2005-06-08)
[261] Putting a form online - (2005-03-29)
[237] Crossfertilisation, PHP to Python - (2005-03-06)
[123] Short underground journeys and a PHP book - (2004-11-19)
Some other Articles
Abstract classes, Interfaces, PHP and JavaControlling, supressing, enabling PHP error messagesUsing print_r in PHP to explore mysql database requestsMoving busstop!Not just a PHP program - a good web applicationTcl scripts / processes on a web server via CGIDiluting HistoryOperator overloading - redefining addition and other Perl tricksWhich version of MySQL am I running?Weekend and Christmas Promotion - Well House Manor Hotel, Melksham