New Perspectives On Web Design

(C. Jardin) #1
By Paul Tero CHAPTER 8

This kind of debugging can be very useful for normal website errors,
too. If you have a feedback form on your website, add the user’s IP address
to the message. If someone reports an error, you can later look through
the logs to see what they have been up to. This is far better than relying on
vague secondhand information about reported problems.
It can also be useful for detecting SQL injection attacks, whereby
hackers try to extract details from your database by fooling your database
retrieval functions. This often involves a lot of trial and error. You could
send yourself an email whenever a database query goes wrong and include
the user’s IP address. You can then cross-reference with the logs to see
what else they have tried.


Last Resorts
William Edward Hickson is credited with popularizing the saying: “If
at first you don’t succeed, try, try, try again.”^19 Hickson was a British
educational writer living in early Victorian times. His advice is not
appropriate for the modern Web developer, lying in bed on a Saturday
morning, drowning in frustration, staring at a blank Web page, preparing
to chuck an expensive laptop against a brick wall.
You’ve now been through all the advice above. You’ve checked that the
world hasn’t ended, verified your broadband box, tested the Internet and
reached your server. You’ve looked for hardware problems and software
problems, and delved into the PHP code. But somehow or other, your
Widget 3000 is still not there. The next thing to do is...


have bReaKfaST


Get out of bed and take your mind off the problem for a little while. Have
some toast, a bowl of cereal, something to drink. Maybe even indulge in a
shower. Try that new lavender and citrus shampoo you bought by mistake.
While you’re doing all this, your subconscious is busily working on the


19 Oxford Dictionary of Quotations (3rd edition), Oxford University Press, 1979

Free download pdf