One Hat Cyber Team
Your IP :
216.73.216.155
Server IP :
122.155.17.190
Server :
Linux cat17190.thaihostserver.com 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64
Server Software :
Apache/2
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
neunkho
/
public_html
/
webboard
/
captcha
/
View File Name :
captcha.class.php
<?php class Captcha{ var $chars = '123456789'; // 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 } } ?>