shah_ankitb Posted April 10, 2007 Share Posted April 10, 2007 Can any body gives me WebLink or Code of 'Captcha',there r many sites where i have find the Captcha code. But i want the code that will be Small & Easy to Undestand. If u have that type of WebLink which is easy to understand & also minimize my space of code. Then please reply as soon as possible. Thanx in Advance. Link to comment Share on other sites More sharing options...
msd Posted April 10, 2007 Share Posted April 10, 2007 You can build it yourself:- generate random text and put it in a session- put the text in an image (http://www.php.net/manual/en/function.imagecreate.php)- after submit, check if users' code matches to the one in the sessionStart on these 3 major steps and ask for details when needed.After this, you'll make more advanced captcha codes, with colors and various backgrounds to make it harder for the bots to read it. Link to comment Share on other sites More sharing options...
vijay Posted April 10, 2007 Share Posted April 10, 2007 Hi..Use the following code... and modify according ur req.. <?phprequire_once("functions.php");//_pr(gd_info());//$size = getimagesize("./image/Blue hills.jpg");//_pr($size,1);$uid=uniqid();$random_str=substr($uid,-6);header("Content-type: image/png");$im = @imagecreate(50, 30) or die("Cannot Initialize new GD image stream");$w = imagecolorallocate($im, 255, 255, 255);$red = imagecolorallocate($im, 255, 0, 0);$background_color = imagecolorallocate($im, 255, 255, 255);$text_color = imagecolorallocate($im, 233, 14, 91);$black = imagecolorallocate($im, 0, 0, 0);// prints a black "P" in the top left corner//imagechar($im, 1, 0, 0, $random_str, $text_color);imagestring($im, 5, 5, 5, $random_str, $text_color);imagepng($im);imagedestroy($im);?> Regards,Vijay Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now