Location: PHPKode > projects > PHP Guestbook > captchaimg.php
<?php session_start();$mz0=base64_decode('QUJDRURGR0hJSktMTU5QUVJTVFVWV1hZWmFiY2RlZmdoaWprbW5wcXJzdHV2d3h5ejEyMzQ1Njc4OQ==');mt_srand((double)microtime()*1000000);$nv1='';for($yx2=0;$yx2<3;$yx2++){$nv1.=substr($mz0,mt_rand(0,strlen($mz0)-1),1);}$_SESSION[base64_decode('Y2FwdGNoYV9yZXN1bHQ=')]=md5(strtoupper($nv1));$fh3=imagefontwidth(5);$hs4=($fh3*strlen($nv1))+7;$hh5=imagefontheight(5)+3;$gf6=imagecreate($hs4,$hh5);$fl7=imagecolorallocate($gf6,230,230,230);$ap8=imagecolorallocate($gf6,100,100,100);$fm9=imagecolorallocate($gf6,170,170,170);for($yx2=0;$yx2<strlen($nv1);$yx2++){imagestring($gf6,5,4+($fh3*$yx2),1,substr($nv1,$yx2,1),$ap8);}imagerectangle($gf6,0,0,$hs4-1,$hh5-1,$fm9);if(function_exists(base64_decode('aW1hZ2VnaWY='))){header(base64_decode('Q29udGVudC10eXBlOiBpbWFnZS9naWY='));imagegif($gf6);}elseif(function_exists(base64_decode('aW1hZ2Vwbmc='))){header(base64_decode('Q29udGVudC10eXBlOiBpbWFnZS9wbmc='));imagepng($gf6);}elseif(function_exists(base64_decode('aW1hZ2VqcGVn'))){header(base64_decode('Q29udGVudC10eXBlOiBpbWFnZS9qcGVn'));imagejpeg($gf6);}imagedestroy($gf6);?>
Return current item: PHP Guestbook