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. Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.