Check out the comparison operators at PHP
http://www.php.net/manual/en/language.operators.comparison.php
Check for empty fields with isset()
http://www.php.net/manual/en/function.isset.php and http://php.net/manual/en/function.empty.php
Also, to check for the length of input, you can use the...