"2012" || $year < "1900") { echo "false"; } else { echo "true"; } return; } $formData = array( "username" => $_POST["username"], "password" => $_POST["password"], "realname" => $_POST["realname"], "birthdate" => $_POST["birthdate"], "email" => $_POST["email"], "ssn" => $_POST["ssn"], "phone" => $_POST["phone"], "zip" => $_POST["zip"], "acceptterms" => $_POST["acceptterms"] ); // check whether the terms are accepted. if ($formData['acceptterms'] != 'true') { $response = "
You need to accept the terms.
"; echo $response; return; } // the registration is successful only if the username is 'admin' and the password is 'admin123'. if ($formData['username'] == 'admin' && $formData['password'] == 'admin123') { $response = "Invalid username or password.
"; } echo $response; ?>