Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Skrypt logowania, Proszę o ocenę
kezman
post
Post #1





Grupa: Zarejestrowani
Postów: 71
Pomógł: 0
Dołączył: 1.12.2008

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


Cześć, napisałem ostatnio skrypt logowania, chciałbym prosić o ocenę "działania", oraz bezpieczeństwa. Za wszelkie poprawki bardzo dziękuję!
  1. <?php
  2. if(isset($_POST['login'])){
  3.  
  4. $login=$_POST['login'];
  5. $haslo=md5($_POST['haslo']);
  6.  
  7. $login = trim(strip_tags($login));
  8. $login = str_replace("<", "&gt;", $login);
  9. $login = str_replace(">", "&gt;", $login);
  10. $haslo = trim(strip_tags($haslo));
  11. $haslo = str_replace("<", "&gt;", $haslo);
  12. $haslo = str_replace(">", "&gt;", $haslo);
  13.  
  14. require_once("config.php");
  15.  
  16. $result = mysql_query("SELECT * FROM user WHERE login='$login' AND haslo='$haslo'");
  17. $num_rows = mysql_num_rows($result);
  18.  
  19. if($num_rows){
  20. header("location:index.html");
  21. }
  22. else
  23. {
  24. $message="Nieprawidłowy Login lub Hasło!!";
  25. }
  26. }
  27. ?>


Ten post edytował nospor 24.08.2009, 11:52:26
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 23.08.2025 - 08:58