Login special characters
#1


Hello.
I have Windows Server 2003 if it helps.
The accounts are registred in mysql.

When someone types for example /login passwordѓ? the server crashes.

How can i solve this ?
Reply
#2

I made this function for you:

Код:
stock IsValidPassword(pass[])
{
  for(new i; i<strlen(pass); i++)
  {
    if((pass[i] < 48) || (pass[i] > 57 && pass[i] < 67) || (pass[i] > 90 && pass[i]< 97) || (pass[i] > 122)) return 0;
  }
  return 1;
}
Just before you write the password to the file, use

Код:
if(IsValidPassword(EnteredPassword))
{
   //password is valid  (only 0-9 or Aa-Zz used)
}
else
{
  SendClientMessage(playerid, 0xFF0000AA, "Invalid password! Please do not use special characters!");
}
Reply
#3

Thx very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)