![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 16 Pomógł: 3 Dołączył: 19.10.2007 Skąd: Gdańsk Ostrzeżenie: (0%) ![]() ![]() |
Witam wszystkich.
Mam kod funkcji logowania: Kod public function loguj($user,$pass) { $lacz = $this->laczbd(); if(!$lacz) return 0; $wynik = $lacz->query("select * from users where login='$user' and haslo=MD5('$pass')"); if(!$wynik) return 0; if($wynik->num_rows>0) return 1; else return 0; } oraz kod sprawdzajacy i ustawiajacy sesje: Kod public function logowanie() { if($_GET["akcja"]=="logout") { unset($_SESSION['zalogowany']); session_destroy(); Header("Location: index.php"); } if($_GET["akcja"]=="login") { $user = $_POST["login"]; $pass = $_POST["pass"]; if($this->loguj($user,$pass)) { $wynik->fetch_array(); $_SESSION['zalogowany'] = "tak"; $_SESSION['access'] = $wynik[0]; $_SESSION['user'] = $wynik[3]; header("Location: index.php"); } } } Wszystko fajnie tylko pokazuje sie blad: Fatal error: Call to a member function fetch_array() on a non-object in /opt/lampp/htdocs/augit/inc/classes.php on line 206 Gdzie jest blad? i jak go naprawic? Pozdr Kreator Ten post edytował kreator 21.10.2007, 16:05:16 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 22.08.2025 - 14:49 |