Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] MD5 a skrypt AJAX CHAT
7ad
post 23.11.2014, 00:07:10
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 18.10.2009

Ostrzeżenie: (0%)
-----


Mam problem z porównaniem hasła do md5(hasła).

Jest to fragment orginalnego skryptu


  1. // The code bellow should work without modification for most users
  2. mysql_connect('localhost', $MySQL_username, $MySQL_password);
  3. mysql_select_db($MySQL_database);
  4. $username = isset($username) ? mysql_real_escape_string($username) : '';
  5. $password = isset($password) ? mysql_real_escape_string($password) : '';
  6.  
  7.  
  8. $result = mysql_query("select * from $MySQL_table where $MySQL_username_field = '$username' and ($MySQL_password_field = '$password' or $MySQL_password_field = MD5('$password') or MD5($MySQL_password_field) = '$password' or $MySQL_password_field = MD5(MD5('$password')) or MD5(MD5($MySQL_password_field)) = '$password')");
  9.  
  10. global $chat_data;
  11.  
  12. return mysql_fetch_assoc($result) ||
  13. isset($chat_data['user'][$username]) &&
  14. isset($chat_data['pass'][$username]) &&
  15. ($chat_data['pass'][$username] == ($password));
  16. }
  17.  


Baza haseł jest w MD5, jeśli w okienku logowania wpiszę hasło Md5, to działa.....
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 16:26