Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] logwanie poprawne
icetab
post
Post #1





Grupa: Zarejestrowani
Postów: 226
Pomógł: 3
Dołączył: 3.04.2007

Ostrzeżenie: (50%)
XXX--


Czy ten skrypt na logowanie jest zabezpieczony i czy jest poprawnie napisany ?

  1. <?php
  2.  if(isset($_POST['login'])){
  3.  $login = $_POST['login'];
  4.  }
  5.  else{
  6.  $login='';
  7.  }
  8. if(isset($_POST['haslo'])){
  9.  $haslo = $_POST['haslo'];
  10.  }
  11.  else{
  12.  $haslo='';
  13.  }
  14.  $l = 'login';
  15.  $h = 'haslo';
  16.  
  17.  if (($login == $l) and ($haslo == $h)){
  18. $_SESSION['logowanie'] = '1';
  19.  }
  20.  else {
  21. if (!isset($_SESSION['logowanie'])){
  22.  $_SESSION['logowanie'] = '0';
  23.  }
  24.  }
  25. if (isset($_SESSION['logowanie']) and ($_SESSION['logowanie'] == 1)){
  26. header ('location: strona.php');
  27. }
  28. else {
  29. echo 'Blad logowania!';
  30. }
  31. ?>


Ten post edytował icetab 20.04.2007, 21:24:48
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: 15.09.2025 - 11:29