Page Stats
Visitor: 287
CAPTCHA is a simple test to determine if a user is a computer or a human. It is used to prevent spam abuse on the websites. So if you use CAPTCHA on your web site forms, this can help in stopping some bots and making life harder for other bots in accessing or using your forms.
In brief the CAPTCHA protection works by generating a random string, writing it to an image, then storing the string inside a session or by some other method. This is then checked when the form is submitted.
File1.php
<style> .text{ border:none; background:#963; letter-spacing:5px; width:70px; padding-left:5px; cursor:default; } </style> <?PHP $a = substr(str_shuffle("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"),0,5); ?> <form action="file2.php"> Enter id <input type="text" name="id"> <br> Enter pass <input type="text" name="pass"> <br> <input type="text" value="<?PHP echo $a;?>" name="a" readonly class="text" onmousedown="return false;"> <input type="text" name="capcha"> <br> <input type="submit" name="submit"> </form>
file2.php
<?php $a=$_GET['a']; $id=$_GET['id']; $pass = $_GET['pass']; $cap =$_GET['capcha']; if(strtolower($cap)==strtolower($a)){ echo "valid"; } else { echo "Invalid"; } ?>