I have a form, but I am having trouble getting the strlen function to work. Below is an example of the code - there is validation further down. I've commented out the code that isn't working. Basically, all I want to do with this section of code is determine that the passwords match, and are more than 7 characters long.
Can anyone help?
if (isset($_POST['formName']) && $_POST['formName'] == "addUser") {
if ( ( $_POST['frmName'] != '') &&
($_POST['frmSurname'] != '') &&
($_POST['frmEmail'] != '') &&
($_POST['frmPassword1'] != '') ) {
if ($_POST['frmPassword1'] != $_POST['frmPassword2'] ) {
echo "Passwords do not match!";
}
/* if (strlen( ($_POST['frmPassword1']) < 7 ) {
echo "Passwords much be a minimum of 7 characters";
} */