Mysql little problem
#1

hi all
i know how to md5 password but idk how to convert the current md5 in the database to the correcct passwords. any ideas?
pls help
Reply
#2

Hashes cannot be decrypted, that's the point of a hash. To check if a password is correct, you'd do this:

pawn Код:
SELECT * FROM Users WHERE Name = 'playername' AND Password = md5('inputtext')
Reply
#3

can you make a little dialog with it pls
Reply
#4

This is a exemple when the dialog response

pawn Код:
new
                query[256],
                playerName[MAX_PLAYER_NAME],
                escapedName[MAX_PLAYER_NAME],
                escapedPassword[129];

            GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);      
            WP_Hash(escapedPassword, sizeof(escapedPassword), inputtext);
            mysql_real_escape_string(inputtext, escapedPassword);
           
            mysql_real_escape_string(playerName, escapedName);

            format(query, sizeof(query), "SELECT * FROM `[YourAccounts]` WHERE [yourfield]= '%s' AND [passfield] = '%s'", escapedName, escapedPassword);
            mysql_query(query, [YourQuery], playerid);
NOTE: YOU HAVE TO CHANGE THE PARAMS IN [ ]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)