Change password(MySQL)
#1

I use this code to change my password but It just removes my already hashed password in database

Код:
WP_Hash(Player[playerid][Password], 129, inputtext);
mysql_format(koneksi, query, sizeof(query), "UPDATE `users` SET `Password` = '%e' WHERE `Name` = '%e'",Player[playerid][Password], PlayerName(playerid));
mysql_query(koneksi, query);
Reply
#2

PHP код:
WP_Hash(Player[playerid][Password], 129inputtext);
mysql_format(koneksiquerysizeof(query), "UPDATE `users` SET `Password` = '%s' WHERE `Name` = '%e'",inputtextPlayerName(playerid));
mysql_query(koneksiquery); 
Reply
#3

Quote:
Originally Posted by justjamie
Посмотреть сообщение
PHP код:
WP_Hash(Player[playerid][Password], 129inputtext);
mysql_format(koneksiquerysizeof(query), "UPDATE `users` SET `Password` = '%s' WHERE `Name` = '%e'",inputtextPlayerName(playerid));
mysql_query(koneksiquery); 
Why are you replacing %e with %s? %e is needed to escape the string. Also, the hashed password is stored in the Player[playerid][Password], using inputtext isn't needed either.
Reply
#4

So how to solve it
Reply
#5

Sorry for bumping but I really need any clue about it
Reply
#6

Show us some more part of the code.
Reply
#7

Just replace inputtext in mysql format with Player[playerid][Password]
Also you dont need to escape password since its hashed with Whirpool, but you can its not gonna break anything.
Reply
#8

Sorry,Didn't update the post
Already fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)