cturner Posted December 4, 2007 Share Posted December 4, 2007 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.'; } Quote Link to comment Share on other sites More sharing options...
revraz Posted December 4, 2007 Share Posted December 4, 2007 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'; } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.