Commit 960d6027 by Visgha Olivia

Upload New File

parent 73b99abe
<?php
session_start();
header("Content-type = image/png");
if(isset($_SESSION['my_captcha'])){
unset($_SESSION['my_captcha']);
}
$string1="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
$string2="1234567890";
$string = $string1.$string2;
$string = str_shuffle($string);
$random_text = substr($string,0,6);
$_SESSION['my_captcha'] = $random_text;
$im = @ImageCreate(70,35)
or die("cannot intialize new GD image stream");
$background_color = ImageColorAllocate($im,235, 235, 235);
$text_color = ImageColorAllocate($im,51,51,255);
ImageString($im,15,8,10,$_SESSION['my_captcha'],$text_color);
ImagePng($im);
imagedestroy($im);
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment