In step 2 of the example -- the validation -- wouldn't you want to trim() the _POST data?
In other words, in this example, if someone put a space in the first_name field in the form, it would slip through the validation and not produce an error -- wouldn't that be the case?