Well, apparently I'm not quite out of the woods yet on this one as I get the wrong error message on a given error. When typing ''aaaaaaaaaaaaa' in a formfield, I don't get the "Failed check for required symbols" message as I should, but the "wrong username" message from later down the script. But when I send an empty form then I get the "Failed check for required symbols" message from the comparison-part of the script. Shouldn't the series of preg_match()'es demand at least one of each character or halt with the appropriate die message? I could understand the situation if I used "OR" in the code, but "AND" and the "+" should demand at least one of each, right?
if (!preg_match('/[a-z]+/', $formpassword) AND
!preg_match('/[A-Z]+/', $formpassword) AND
!preg_match('/[0-9]+/', $formpassword)) {
echo "<span class='warning'>$formpassword ERROR: Failed check for required symbols in password. Please adhere to the specifications given.</span>";
die($loginform);
}
elseif (!preg_match('/[a-z]+/', $formusername) AND
!preg_match('/[A-Z]+/', $formusername) AND
!preg_match('/[0-9]+/', $formusername)) {
echo "<span class='warning'>$formusername ERROR: Failed check for required symbols in username. Please adhere to the specifications given.</span>";
die($loginform);
}