Page 1 of 1

Using # in password

Posted: Thu Mar 17, 2022 7:34 pm
by wwonderfull
When registering in signup is there any restriction using # in password for example.... james#1738. The database does not seem accept # inside the password although I am testing it in wamp server any idea?

Re: Using # in password

Posted: Thu Mar 17, 2022 9:07 pm
by Pablo
For security reasons, the login forms only accepts ASCII characters.
If you want more control then you can convert the login form to a standard form and change the validation in the script.

Re: Using # in password

Posted: Fri Mar 18, 2022 7:41 am
by wwonderfull
Pablo wrote: Thu Mar 17, 2022 9:07 pm For security reasons, the login forms only accepts ASCII characters.
If you want more control then you can convert the login form to a standard form and change the validation in the script.

Code: Select all

}
   else
   if (!preg_match("/^[A-Za-z0-9-_!@$]{1,50}$/", $newusername))
   {
      $error_message = 'Username is not valid, please check and try again!';
   }
   else
   if (!preg_match("/^[A-Za-z0-9-_!@$]{1,50}$/", $newpassword))
   {
      $error_message = 'Password is not valid, please check and try again!';
   }
   else
   if (!preg_match("/^[A-Za-z0-9-_!@$.' &]{1,50}$/", $newfullname))
   {
      $error_message = 'Fullname is not valid, please check and try again!';
   }
would adding a "#" inside of (!preg_match("/^[A-Za-z0-9-_!@#$]{1,50}$/", $newpassword)) do the trick ? Can you please give the code example if I am incorrect.

Re: Using # in password

Posted: Fri Mar 18, 2022 8:09 am
by Pablo
I'm sorry, I cannot help you with custom code.
But you are right tat this regular expressions must be modified.

Re: Using # in password

Posted: Fri Mar 18, 2022 8:25 am
by wwonderfull
That code up there was generated from the converted signup form. But I did some search and got a website where we can validate our password expressions https://regexr.com/ I hope others find it useful too. I like it :D