smc Posted June 15, 2007 Share Posted June 15, 2007 Hello everybody, Okay this is kinda rediculous. I need a tutorial on how to make those randomly generated images and the scripts that go along with it to prevent against machine automatation. The trouble is, I totally forgot what it is technically called thus Google yields little help. I was wondering if you could point me in the right direction so I can get going! Thanks~ -SMC Link to comment https://forums.phpfreaks.com/topic/55667-tutorial-on-how-to-generate-those-pictures/ Share on other sites More sharing options...
rtpmatt Posted June 15, 2007 Share Posted June 15, 2007 its called a captcha and if you ware using PHP and PEAR, I believe their is a pear package that will take care of them for you....in fact, there seems to be a few: http://pear.php.net/search.php?q=captcha+&in=packages Link to comment https://forums.phpfreaks.com/topic/55667-tutorial-on-how-to-generate-those-pictures/#findComment-275079 Share on other sites More sharing options...
redarrow Posted June 15, 2007 Share Posted June 15, 2007 All you need is to add a plane .png picture ok. Here you go a captcha code for you to learn ok. here a link for an example tell me what you think just programmed it now for you? http://freesingles.ath.cx/php_freaks/ <?php ob_start(); session_start(); if( $_GET['cmd']=="get"){ if ($new_string == $random){ echo "<center> <b> Congratulations Code Correct ! </b> </center>"; }else{ echo "<center> <b> Dam You Code Incorrect ! </b> </center>"; } } $new_string=$_POST['new_string']; $random=$_POST['random']; session_register('new_string'); $im = ImageCreate(150, 20); $white = ImageColorAllocate($im, 255, 255, 0); $black = ImageColorAllocate($im, 255, 69, 0); srand((double)microtime()*1000000); $string = md5(rand(0,9999)); $new_string = substr($string, 17, 5); ImageFill($im, 0, 0, $black); ImageString($im, 4, 60, 3, $new_string, $white); // a plane .png picture please Imagepng($im, "grey.png"); ImageDestroy($im); ?> <center> <form method="POST" action="<?php $_SERVER['PHP_SELF']; ?>?cmd=get"> <?php // a plane .png picture please echo "<img src=\"grey.png\">"; ?> <br> <input type="text" name="random" value="Please enter code... "> <p></p> <input type="submit" name="submit" value="Register"> </form> </center> Link to comment https://forums.phpfreaks.com/topic/55667-tutorial-on-how-to-generate-those-pictures/#findComment-275091 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.