Problem with a class... any help will be appreciated.
| From: | Elliot J. Balanza | Date: | Thu, 29 Apr 2004 02:28:22 +0000 |
| Subject: | Problem with a class... any help will be appreciated. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-184918@lists.php.net to get a copy of this message | ||
I have a class
class security {
function blank($user,$pass) {
if((empty($user)) || (empty($pass)))
return 1;
else
$this -> revisa();
}
function revisa () {
$this -> login();
}
function login() {
$_SESSION['User']=$user;
$_SESSION['Nivel']=$nivel;
$this -> registra_entrada();
}
function registra_entrada() {
header("location:../includes/login.php");
}
}
?>
and it works great ... but this wont work at all, all it wont go from one
part tot he other, any ideas what am I doing wrong?
class security {
function blank($user,$pass) {
if((empty($user)) || (empty($pass)))
return 1;
else
$this -> revisa();
}
function revisa () {
$query_revisa = $this->dbQuery("SELECT User, Password, Nivel FROM
Admon WHERE User = '$user'");
$row_revisa = $this->dbFetchArray($query_revisa);
if(md5($pass)==$row_revisa['Password']) {
$this -> login();
} else {
return 1;
}
function login() {
$_SESSION['User']=$user;
$_SESSION['Nivel']=$nivel;
$this -> registra_entrada();
}
function registra_entrada() {
$query_registra=$this->dbQuery("INSERT INTO admon_log (User) VALUES
('$user')");
header("location:../includes/login.php");
}
}
?>