ok
Direktori : /home/ngwcolle/public_html/ICICI_MS_LIVE/ |
Current File : /home/ngwcolle/public_html/ICICI_MS_LIVE/captcha.php |
<?php error_reporting(E_ALL); // Generate a random code // $code = rand(1000, 9999); // // Store the code in a session variable // $_SESSION['captcha'] = $code; // // Generate an image with the code // $image = imagecreate(100, 30); // imagecolorallocate($image, 255, 255, 255); // $font = 'Roboto.ttf'; // // $font = dirname(__FILE__) . '/fonts/arial.ttf'; // $text_color = imagecolorallocate($image, 0, 0, 0); // imagettftext($image, 20, 0, 10, 25, $text_color, $font, $code); // header('Content-Type: image/png'); // imagepng($image); // imagedestroy($image); session_start(); // $random_alpha = md5(rand()); $captcha_code = rand(10000, 99999); // echo $captcha_code; $_SESSION['captcha_code'] = $captcha_code; header('Content-Type: image/png'); $image = imagecreatetruecolor(200, 38); $background_color = imagecolorallocate($image, 231, 100, 18); $text_color = imagecolorallocate($image, 255, 255, 255); imagefilledrectangle($image, 0, 0, 200, 38, $background_color); $font = dirname(__FILE__) . '/Roboto.ttf'; imagettftext($image, 20, 0, 40, 28, $text_color, $font, $captcha_code); imagepng($image); imagedestroy($image); // Generate an image with the code