i want the code for
if user try to access the login screen for more than 3 times with invalid password then account should lock
plzzzzzzzzzzzz......
bbinais
0
Light Poster
Recommended Answers
Jump to Postjust intialize a session with username and logincounter like $_SESSION and $_SESSION
for every try increment the logincounter session for the same username..
if its greater than 3 then dont' allow for login..or post your code, we will check it out..
Jump to Posttry this:
if($count==1) { if(!isset($_SESSION['txtusername'])) { session_register("txtusername"); session_register("txtpassword"); session_register("login_counter"); $_SESSION['login_counter']=0; $_SESSION['txtusername']="";// intialize name header("location:Main_Dashboard.php"); } else { $_SESSION['login_counter']=$_SESSION['login_counter']+1; } }
and to validate:
if(isset($_SESSION['login_counter']) && ($_SESSION['login_counter']==3)) { echo "Please wait for some time!"; }
Jump to Post@bbinais
Please use code tags [ CODE ]. I'm getting a headache trying to read your code.
Jump to PostYou have to increment session login_counter before redirect to the Main_Login.php page..
see this:if(!isset($_SESSION['txtusername'])) { session_register("txtusername"); session_register("txtpassword"); session_register("login_counter"); $_SESSION['login_counter']=0; $_SESSION['txtusername']=""; header("location:Main_Dashboard.php"); } else { $_SESSION['login_counter']=$_SESSION['login_counter']+1; header("location:Main_Login.php"); } }
and put this code in Main_Login.php page:
if(isset($_SESSION['login_counter']) && ($_SESSION['login_counter']==3)) { echo "Please wait for …
Jump to Post$encrypted_mypassword=md5($mypassword);
do u use md5() when u insert password in the sql table?
maybe that is ur fault
if so try to use$sql="SELECT * FROM $tbl_name WHERE MUSE_NAME='$myusername' and MUSE_PWD=MD5('$mypassword')";
hope that may help
All 23 Replies
Shanti C
106
Posting Virtuoso
bbinais
0
Light Poster
bbinais
0
Light Poster
Shanti C
106
Posting Virtuoso
bbinais
0
Light Poster
diafol
Shanti C
106
Posting Virtuoso
bbinais
0
Light Poster
bakir
0
Light Poster
bakir
0
Light Poster
bbinais
0
Light Poster
bbinais
0
Light Poster
bbinais
0
Light Poster
bbinais
0
Light Poster
bakir
0
Light Poster
bbinais
0
Light Poster
bakir
0
Light Poster
bbinais
0
Light Poster
Shanti C
106
Posting Virtuoso
bakir
0
Light Poster
bbinais
0
Light Poster
bakir
0
Light Poster
bbinais
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.