Birthday Card
A first PHP page: the birthday card's heading and picture are written out with PHP echo statements.
Exercises from my server-side programming class, where I learned PHP: building pages on the server, validating forms, reading files and writing object-oriented code. Each one is kept as I built it.
Pages generated on the server, and form input checked with regular expressions.
A first PHP page: the birthday card's heading and picture are written out with PHP echo statements.
A contact form checked on the server with regular expressions (names, 10-digit phone, email, 5-digit ZIP). Mistakes are flagged next to the field with your entries kept; valid input shows a confirmation screen.
Classes, constructors, getters and setters, inheritance and exceptions.
A Dog class with a constructor, getters and setters, a check that age is a positive number, and a __toString() method that prints each dog's details.
An Animal base class with Dog and Bird subclasses that override talk() and move(). Bird adds a wingspan, and invalid numbers throw exceptions.
Client-side work from the same class: canvas animation, keyboard control and event listeners.
30 randomly sized and coloured balls bounce around a full-window HTML canvas, drawn with requestAnimationFrame and a Ball object.
PHP builds a 10×10 grid. Use the arrow keys to turn the robot, Space to move, Enter to drop or pick up a beeper (three to start) and Esc to reset.
keyup event listeners test a phone number and an email address against regular expressions and say whether each is valid as you type.
The submit button stays disabled until the password and confirm-password fields match, with a live message that updates on every keystroke.
Database-backed exercises from this class (the poll, palindromes, product catalogue, log-ins and sessions) aren't linked because the database they used has been retired. A few unfinished practice pages are also left out.