tbobker Posted July 7, 2006 Share Posted July 7, 2006 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. Link to comment https://forums.phpfreaks.com/topic/13971-javascript-count-number-times-login-is-wrong/ Share on other sites More sharing options...
micah1701 Posted July 7, 2006 Share Posted July 7, 2006 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...[code]<?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 reloadsfailed Login. You have attempted to log in <?php echo $_SESSION['logInAttempts'] ?> time(s)[/code] Link to comment https://forums.phpfreaks.com/topic/13971-javascript-count-number-times-login-is-wrong/#findComment-54512 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.