Forums

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

#203231
cscodismith
Participant

I believe that I have set the username field to Unique within the database but am not sure really if it will still allow people to register with the same username or not. I have been having problems making restrictions happen in the registration page of this project.

For example, I have tried to make the username requirement to be at least 6 characters long with the following code:

<?php
if (strlen(':username')<6) {
   echo "Username must be atleast 6 characters";
} else {
   echo '<button type="submit" style="width: 100%; padding: 10px 5px;">Register account</button><br><br>';
}
?>

When testing the code above clicking on the submit button it would still register the username and other credentials no matter what even though the purpose of it is to make sure that nobody registers a username that isn’t a minimum of 6 characters. I have updated the source code on pastebin that can be found here if you would like to take a look at it for me.