Jump to content

Display a login error - username less than 6 characters. How?


cturner

Recommended Posts

I am trying to display an error only if the user has entered a username that is less than 6 characters. It hasn't worked for me. When I test the whole code and enter a username of 6 characters or more, it displays an error. It should only display login error when the username is less than 6 characters. So can someone please tell me how I can do this? Thanks in advance.

 

Here is my code:

if (strlen($_POST['username']) < 6) {
$arrErrors['username'] = 'Login error.';
}

Looks good, i use this and it works.  Maybe verify the name in the form matches the name in the variable.

 

if (trim (strlen($uname)) >= 6)  {
			if (checkUnique ("users", "uname", $uname) == FALSE) {
				$errorList[] = 'Username Taken, please try another Username';
				}
		}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.