Jump to content


Photo

javascript count number times login is wrong


  • Please log in to reply
1 reply to this topic

#1 tbobker

tbobker
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 07 July 2006 - 06:51 PM

on my login script i want it to display a message only if they have got the username and password wrong more than once. I have tried various while loops and so on but cant get it to only display one time because of the loop it keeps displaying the message again and again.



#2 micah1701

micah1701
  • Members
  • PipPipPip
  • Advanced Member
  • 613 posts
  • LocationEllington, CT USA

Posted 07 July 2006 - 07:14 PM

I'm not sure I follow what your doing... whats w/ the loops? Maybe post a bit of code.

I use php session to track failed loggins...

<?php  
session_start();

if($_POST['submit']){
//check for valid log in.
//if it works, log them in,
//if it fails...
$_SESSION['logInAttempts'] = ++; //add 1 to the current value.
if($_SESSION['logInAttempts'] > 3){
header("Location: youLose_nowGoAway.php");
exit();
}
}
?>
Then, in your form, when it reloads

failed Login. You have attempted to log in <?php echo $_SESSION['logInAttempts'] ?> time(s)

"Confidence in the face of risk."




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users