PHP Coding Test

Here is the standard PHP programming exercise designed by Sigurd that we ask programmers to perform to assess their ability to work with us. You are to do this in your own time, with full access to the internet. Rather than asking multichoice questions about what you have memorised, the intent here is to test how well you can learn and use online knowledge, and how well you solve a small but broad programming challenge, in an environment similar to normal working conditions.

Browser Poll

Write a PHP5, MySQL, Javascript program that asks people for their favourite webbrowser. It should gather this information via the following form;

  • Your name
  • Your email address
  • Favourite browser (Allows only these options: Internet Explorer, FireFox, Safari, Opera, Konqueror, Lynx)
  • Reason (a largish text box)

After confirming the fields have been appropriately filled out (using client-side javascript), it should save the information so that it can provide statistics for all submissions. The visitor should immediately see;

  • Total votes for each of the webbrowsers, as a raw count, and as a percentage of all votes.
  • Underneath, a list showing all of the responses. This is to be done as table with columns: Name, Email, Browser, Reason, Time Submitted. It is to be in a specific order too; grouped firstly by webbrowser, then ordered by time/date.

Each time the form is submitted, it should email the person with a record of everything they entered.

To prevent duplications, if an email address is already in the poll, it should replace the old saved response with the newly submitted one.

Demonstrate your command of

  • webstandards (XHTML/CSS, semantic code, external CSS files, appears and behaves identically in major browsers),
  • well named functions, variables, HTML ID/CLASSes
  • appropriate use of language constructs like loops, if..else, switch, functions, arrays, classes, objects, etc.

Please find a suitable web-host and place it there, and send us

  • URL to your work
  • URL to login and see the database (e.g. with phpmyadmin)
  • An email with a zip file containing all the php/css etc files so we can look at your source code easily