/
home
/
mantaraham
/
public_html
/
File Upload :
llllll
Current File: /home/mantaraham/public_html/php_captcha.php
<?php session_start(); function generateCode($characters) { /* list all possible characters, similar looking characters and vowels have been removed */ $possible = '123456789'; $code = ''; $i = 0; while ($i < $characters) { $code .= substr($possible, mt_rand(0, strlen($possible)-1), 1); $i++; } return $code; }; $ResultStr = generateCode(3); $im =imagecreatefromjpeg("images/captcha.jpg"); //$im = imagecreate(400,30); $black = imagecolorallocate($im, rand(0,140),rand(0,140),rand(0,140)); $_SESSION['key'] = $ResultStr; // Replace path by your own font path imagettftext($im, 16, 0, 4, 26, $black, "fonts/IRAN.ttf",$ResultStr); header("Content-type: image/jpeg"); imagejpeg($im); imagedestroy($im); ?>
Copyright ©2k19 -
Hexid
|
Tex7ure