The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Need help with login form Reply To: Need help with login form


Alright thank you I will give it a try again. I did not mean to make it sound like I want every user to have a username less then 6 characters, I meant I would them to each have a username that must be AT LEAST 6 characters.

My problem is when I write code to do so and it is supposed to echo an error when they try to submit the form with a username less than 6 characters it will redirect them to the form as to where the error will display for them and they will have to fix the username field. The code I had tried to do this was:

if(strlen(':username')<6 || strlen(':username')>25) {
   echo 'Username must be between 6 and 25 characters.';
   header("Location: register.php");

Unfortunately this code still allows users credentials (No matter what length of the username) be put into the database and the echo placed does not take effect.