Jump to content
  • 0

Problema md5


repLay

Question

salut , am trecut serverul pe mysql si am hotarat sa pun parolele cryptate cu md5 dar la onplayerlogin am o eroare

deci cand isi face cont , trece in baza de date parola cryptata cum trebuie

	new EscapedText[60];
	mysql_real_escape_string(password, EscapedText);
	format(string, sizeof(string), "INSERT INTO users (Nume,Parola) VALUES ('%s',MD5('%s'))", loginname, EscapedText);
	mysql_query(string);
dar la onplayerlogin zice ca parola nu e buna
	new EscapedText[60];
	mysql_real_escape_string(password, EscapedText);
    format(query, sizeof(query), "SELECT * FROM users WHERE `Nume` = '%s' AND `Parola` = MD5('%s') LIMIT 1", loginname, EscapedText);
    mysql_query(query);
in debug apare asa
[11:37:09] CMySQLHandler::Ping() - Connection is still alive.
[11:37:09] >> mysql_real_escape_string( Connection handle: 1 )
[11:37:09] CMySQLHandler::EscapeString(parola); - Escaped 6 characters to parola.
[11:37:09] >> mysql_query( Connection handle: 1 )
[11:37:09] CMySQLHandler::Query(SELECT * FROM users WHERE `Nume` = 'Bogdan' AND `Parola` = MD5('parola')) - Successfully executed.
[11:37:09] >> mysql_store_result( Connection handle: 1 )
[11:37:09] CMySQLHandler::StoreResult() - Result was stored.

cum pot face MD5('') sa nu il vada ca text?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

incearca asta atunci cand verifici parola

[pawn]

new EscapedText[60];

mysql_real_escape_string(password, EscapedText);

    format(query, sizeof(query), "SELECT Parola FROM users WHERE `Nume` = '%s' AND `Parola` = MD5('%s') LIMIT 1", loginname, EscapedText);

    mysql_query(query);

[/pawn]

Pentru ca tie nu iti trebuie toata linia iti trebuie doar continutul din campul "Parola"

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.