Inside the Calculators – Overview
Here’s a (simplified) overview of how my permanent disability/impairment and workers’ compensation benefits calculators work. As I’ve mentioned elsewhere, I wrote these website calculators using javascript, PHP, MySQL, and AJAX.
In a recent post, I created a really simple test for cell phones using the above languages. Here’s what was happening:
- The user clicks the button “Cell Test.”
- The javascript embedded in the button detects the “click.”
- The javascript embedded in the button then tells an AJAX program that the button was clicked.
- AJAX sends a little bit of information to the web server – saying that the user clicked that button.
- The PHP program on the server is notified that the button was clicked.
- The PHP program checks a MySQL table to see what it should happen when that button is clicked.
- The MySQL table returns the answer, what should happen when a button is clicked, to the PHP program.
- The PHP program takes the answer from the MySQL table and sends it back to the AJAX program.
- The AJAX program takes that information and, using a little bit of javascript, displays the answer in your web browser.
Easy!