Re: vars between instantiate class...

From: Date: Thu, 04 Sep 2003 04:18:20 +0000
Subject: Re: vars between instantiate class...
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-161614@lists.php.net to get a copy of this message
Pass the value $this->_loginAttempts to the same page, assign it to $this->_loginAttempts and then increment it. -Murugesan "jsWalter" <jsWalter@torres.ws> wrote in message news:20030904040827.18663.qmail@pb1.pair.com... > I am trying to see how many times a person has tried to log in during a > session. > > the login script... > > $objAuth->start(); > > if ($objAuth->getAuth()) // is user logged in already > ...display hello page... > else > ...display login page > > OK, so far so good. > > If the user punches in anything wrong, the login gets displayed again. > > Now I want to track this iteration of attempts. > > In the START method, I did this... > > $this->_loginAttempts = $this->_loginAttempts + 1; > > then I added > > echo $objAuth->getLoginAttempts(); > > before ...display login page... to see how it tracks. > > It always displays '1' > > To me, it looks like '$objAuth->start();' , which is called each time the > page runs, which is each time a login attempt is made, is re-initializing > all the class vars to their default state. > > If I make _loginAttempts = 8, then it displays 9. > > So, my question (this time) is how do I get the class to track this counter? > > I hope I explained this well enough. > > I really don't think this is a PEAR::Auth specific question. I think it's > just a "how do I keep this counter going in a class" question. > > Thanks > > Walter > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#161614) next »