jjjhbj111 wrote:
> Hi I have my login but does anybody know how to make it
conditionally hide
> after 3 attempts to show a link to the lost password
page?
I'm not sure this is a very secure idea. Somebody tries to
break in
three times and you offer them a quick way of retrieving the
password?
> I know I have to do some sort of counter using sessions
but for which column
> in the database?
Although I don't think it's a good idea, this is how you do
it:
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 1;
}
else {
$_SESSION['count']++;
}
if ($_SESSION['count'] > 3) {
// display the error message
}
else {
// display the login form
}
--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/