To check if fields are empty use if (!$_POST["fieldname"]) { die("somemessage"); }
For password if($_POST["firstpassword"]!=$_POST["secondpassword"]) { die("somemessage"); } replace POST with GET if you use that method. Be sure to encode password and escape all user inputs.