Show Captcha on Login Failed Attempts
Submitted by alpha_luna on Wednesday, August 17, 2016 - 17:12.
Show Captcha on Login Failed Attempts
If you are looking for Show Captcha on Login Failed Attempts then you are at the right place. In the previous tutorial, we already saw about user login and PHP captcha. In this tutorial, we are going to combine this two tutorial to create a powerful login using captcha. If the user tried more than 3 failed login attempts, then the captcha will show to add control for invalid login. In the example below, we have to calculate the number of failed login attempts based on the IP Address. More than 3 failed login attempts, then the captcha will be displayed to the user to continue the login. You can also check the live demo of this simple tutorial, so you can get an idea and you can try this out, let's start coding.Markup of Login Form and Captcha
This simple HTML source code contains login form and captcha code. Where the user can type the account details to log in.- <form method="post" class="form_style" action="">
- <table cellpadding="10" cellspacing="" width="500" align="center">
- <tr class="tableheader">
- </tr>
- <tr class="tablerow">
- </tr>
- <tr class="tablerow">
- </tr>
- <?php if (isset($failed_attempt_to_login) && $failed_attempt_to_login >= 3) { ?>
- <tr class="tablerow">
- </tr>
- <?php } ?>
- <tr class="tableheader">
- </tr>
- </table>
- </form>
Captcha Source Code
This simple source code to create a captcha code.- <?php
- $_SESSION["captcha_code"] = $captcha_code;
- ?>
Output
Simple Log In Form

Add new comment
- 454 views