Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> programowanie obiektowe - logowanie
Artu123
post
Post #1





Grupa: Zarejestrowani
Postów: 211
Pomógł: 0
Dołączył: 8.12.2008

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


  1. <?php
  2. class Rejestracja {
  3.  
  4.    var $user;
  5.    var $pass;
  6.    var $zalogowany;
  7.        
  8.    function Zalogowany() {
  9.    
  10.        if(mysql_num_rows(mysql_query("SELECT id FROM logowanie WHERE login = '".$this->user."' AND pass = '".md5(md5($this->pass))."'"))) {
  11.        
  12.            return true;
  13.                    
  14.        } else {
  15.                            
  16.            return false;
  17.        
  18.        }
  19.  
  20.    }
  21.    
  22.    function Sprawdzanie($login , $haslo) {
  23.    
  24.        if($this->zalogowany != 'tak') {
  25.    
  26.        $this->user = $login;
  27.        $this->pass = $haslo;
  28.        
  29.        if($this->user != '' && $this->pass != '') {
  30.        
  31.            if($this->Zalogowany() == true) {
  32.            
  33.                return true;
  34.                
  35.                $this->pass = 'tak';
  36.            
  37.            } else {
  38.            
  39.                return false;
  40.            
  41.            }
  42.                                                        
  43.        } else {
  44.        
  45.        return false;
  46.        
  47.        }
  48.        
  49.        } else {
  50.        
  51.            return true;
  52.        
  53.        }
  54.            
  55.    }
  56.  
  57. }
  58. ?>


Mam taki kod i mam z nim problem , a mianowicie w tym miejscu :

  1. <?php
  2. if(mysql_num_rows(mysql_query("SELECT id FROM logowanie WHERE login = '".$this->user."' AND pass = '".md5(md5($this->pass))."'"))) {
  3.        
  4.            return true;
  5.                    
  6.        } else {
  7.                            
  8.            return false;
  9.        
  10.        }
  11. ?>


Wpisany login i hasło jest prawidłowy, a zwraca cały czas false .
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 Aktualny czas: 20.08.2025 - 21:49