Problem with register / whirlpool
#1

Hello;

I have a little problem with this code in one time the Encrypt wasn't made then, I change for this actual code and the encrypt is successfull but the Name of the player isn't saved in the mysql database I don't know what exactly is wrong I hope anybody might help me

PHP код:
//Dialog to get connected and  not registered
        
case Register_doc:
        {
        if(
response == 0)
            {
                  
Kick(playerid);
                  return 
1;
            }
            else
            {
                if(
strlen(inputtext))
                {
                    new 
tmppass[64];
                    
strmid(tmppassinputtext0strlen(inputtext), 255);
                    
OnPlayerRegister(playerid,inputtext);
                    return 
1;
                }
                else
                {
                    
ShowRegisterDialog(playerid);//Register_doc
                    
return 1;
                }
            }
        } 
PHP код:
public OnPlayerRegister(playeridpassword[])
{
    if(
IsPlayerConnected(playerid))
    {
        
MySQLCheck();
         new 
playername3[MAX_PLAYER_NAME];
                         
GetPlayerName(playeridplayername3sizeof(playername3));
        new    
escapedPassword[129];
        
WP_Hash(escapedPasswordsizeof(escapedPassword), password);
        new 
newaccountsqlid InsertPlayer(playername3escapedPassword);
        if (
newaccountsqlid != 0)
        {
            
//Register data
        
}
        else
        {
            
SendClientMessage(playeridCOLOR_RED"Error occurred, Disconnected.");
//            Kick(playerid);
            
return 0;
        }
    }
    return 
0;

PHP код:
//stock
stock InsertPlayer(pname[], password[])
{
    new 
query[200], escapednameMAX_PLAYER_NAME ],escapedPassword[129];
    
mysql_real_escape_stringpnameescapedname );
    
WP_Hash(escapedPasswordsizeof(escapedPassword), password);
     
format(querysizeof(query), "INSERT INTO "TABLENAME" (`"User_Name"`, `"P_Passswd"`) VALUES ('%s', '%s')"escapednameescapedPassword);
    
mysql_query(query);
    new 
newplayersid E_user(pname);
    if (
newplayersid != 0)
    {
        return 
newplayersid;
    }
    return 
0;

Reply


Messages In This Thread
Problem with register / whirlpool - by Jex_Lafer - 29.05.2014, 06:55

Forum Jump:


Users browsing this thread: 1 Guest(s)