Help with names on login/register.
#2

"if( sscanf( inputtext, "s[25]", lPassword ) )"
This is in your DIALOG_LOGIN dialog.
Well, this just stores the string inputtext to lPassword which means that there is no comparison at all if the password is correct.
You rather need a function to compare strings, namely strcmp (=string compare). It will return 0 if the two given strings are the same.
So you will need this:
PHP код:
if(strcmp(inputtext,lPassword)){ 
    
//stuff here if the password is wrong
}
else if( 
strleninputtext ) < || strleninputtext ) > 24 )
    return 
ShowPlayerDialogplayeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"{FFFFFF}Login: {FF0000}characters error{FFFFFF}:""{FFFFFF}Please enter in the box bellow your password.\n{FFFFFF}This password must have at least: {FF0000}6 {FFFFFF}characters:""Login""New Name");
else if( 
strfindinputtext"'"true ) != -)
    return 
ShowPlayerDialogplayeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"{FFFFFF}Login: {FF0000}invalid characters{FFFFFF}:""{FFFFFF}Please enter in the box bellow your password.\n{FF0000}ATTENTION: {FFFFFF}You can't use this (') in your password:""Login""New Name" );
else
{
    
mysql_real_escape_stringinputtextlPasswordDB_Connect );
    
mysql_formatDB_ConnectQuerysizeofQuery ), "SELECT * FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'"PlayerNameplayerid ), lPassword );
    
mysql_tqueryDB_ConnectQuery"LoadPlayerData""is"playeridPlayerNameplayerid ) );

Also not the else statements which I added.
Reply


Messages In This Thread
Help with names on login/register. - by FaLLenGirL - 09.01.2017, 13:44
Re: Help with names on login/register. - by SoLetsGO - 09.01.2017, 14:32
Re: Help with names on login/register. - by SoLetsGO - 09.01.2017, 14:42
Re: Help with names on login/register. - by Vince - 09.01.2017, 14:46
Re: Help with names on login/register. - by SoLetsGO - 09.01.2017, 14:53
Re: Help with names on login/register. - by FaLLenGirL - 09.01.2017, 15:23
Re: Help with names on login/register. - by SoLetsGO - 09.01.2017, 15:42
Re: Help with names on login/register. - by FaLLenGirL - 09.01.2017, 15:43
Re: Help with names on login/register. - by SoLetsGO - 09.01.2017, 15:49
Re: Help with names on login/register. - by FaLLenGirL - 09.01.2017, 19:06

Forum Jump:


Users browsing this thread: 1 Guest(s)