FW: [PHP] PHPLIB and Auth

From: Date: Mon, 19 Mar 2001 10:52:07 +0000
Subject: FW: [PHP] PHPLIB and Auth
Groups: php.general 
Request: Send a blank email to php-general+get-44521@lists.php.net to get a copy of this message
-----Original Message----- From: Steve Haemelinck [mailto:steve.haemelinck@pandora.be] Sent: maandag 19 maart 2001 11:52 To: 'Steve Haemelinck' Subject: RE: [PHP] PHPLIB and Auth It has certainly got something to do with my config. I just tried a simple form with POST And it gave the following ERROR: Parse error: parse error, expecting 'T_STRING' or 'T_VARIABLE' or 'T_NUM_STRING' What does this mean? -----Original Message----- From: Steve Haemelinck [mailto:steve.haemelinck@pandora.be] Sent: maandag 19 maart 2001 10:26 To: PHP Mailing Listl (E-mail) Subject: [PHP] PHPLIB and Auth Hi Guys, I really have a stupid problem but I don't see it :). I wanted to implement authentification with PHPLIB but it seems I am not able to get it working. What happens: If I want to access a page which needs authentification I first get the loginform, so far so good, but when I enter a username and password and submit it, I always get the loginform with the message "Invalid username or password try again". First I thought it was because I had badly configured my database, but the example below shows my database wasn't causing the problem. I think the problem is my loginform, but I don't see how. Do I have to make a setting in my php.ini, what is wrong ???? <?php class TIMEKEEPER_AUTH extends Auth{ /* Declare variables */ var $classname="TIMEKEEPER_AUTH"; var $magic="TIMEKEEPER_MAGIC"; var $lifetime; //Maximum 15 minutes idle time !!! var $database_class = "TIMEKEEPER_DB"; var $database_table = "auth_user"; function auth_loginform() { global $sess; include("loginform.ihtml"); } function auth_validatelogin() { global $username, $password; if(isset($username)) { $this->auth["uname"]=$username; } $uid = false; $this->db->query(sprintf("select * from %s where ( username = '%s' ) and ( password = '%s' )", $this->database_table, addslashes($username), addslashes($password))); while($this->db->next_record()) { $uid = $this->db->f("user_id"); $this->auth["perm"] = $this->db->f("perms"); } return $uid; } } /* test to see if everyting is working well with db-backend*/ $db = new TIMEKEEPER_DB; $db->query("select count(*) as count from auth_user"); $db->Next_Record(); $count = $db->f("count"); //count gives 2 which is correct SO OK $username="webadmin"; $password="wwwadmin"; $database_table="auth_user"; $db->query(sprintf("select * from %s where ( username = '%s' ) and ( password = '%s' )", $database_table, addslashes($username), addslashes($password))); $db->Next_Record(); $uid = $db->f("user_id"); //uid gives ... which is correct SO OK ---> The must be something wrong with my loginform it does not submit the right values WHY ???? ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#44521) next »