Hi,

I have created a login code which adds the firstname and surname to the database. However when the cells are left blank they do not provide the first 2 error messages below. However the 3rd error messages works. Does anyone have any suggestions why the first two error messages dont work.


Code:
    if(isset($_POST['registerSubmit']) && $_POST['registerSubmit'] == 'true'){
    $firstname = mysql_real_escape_string(trim($_POST['firstname']));
    $surname = mysql_real_escape_string(trim($_POST['surname']));
        $registerEmail = trim($_POST['email']);  
        $registerPassword = trim($_POST['password']);  
        $registerConfirmPassword    = trim($_POST['confirmPassword']);  
                  
    if(!isset($firstname) || empty($firstname)) {
        $error = "Please enter your First Name.";
    }
	
	if(!isset($surname) || empty($surname)) {
        $error = "Please enter your Surname.";
    }
				  
        if(strlen($registerPassword) < 6 || strlen($registerPassword) > 12)     
            $errors['registerPassword'] = 'Your password must be between 6-12 characters.';