复制内容到剪贴板
代码:
<?php
header("Content-type: image/jpg");
$img=imagecreate(100,40);
$bg=imagecolorallocate($img,111,119,145);
$linecolor=imagecolorallocate($img,0,0,0);
imageline($img,rand(49,50),rand(0,30),rand(50,100),rand(0,100),$linecolor);
imageline($img,rand(0,50),rand(0,20),rand(0,50),rand(0,20),$linecolor);
imageline($img,rand(0,50),rand(0,20),rand(0,50),rand(0,20),$linecolor);
imageline($img,rand(0,50),rand(0,20),rand(0,50),rand(0,20),$linecolor);
imageline($img,rand(0,50),rand(0,20),rand(0,50),rand(50,100),$linecolor);
$font = 'SIMYOU.TTF';
$text_color = imagecolorallocate($img, 0, 0, 0);
$rand_array=array(
0=>array(65,90),
1=>array(97,122),
2=>array(48,57)
);
for($i=0;$i<=3;$i++) {
$tt=rand(0,2);
$rand_num[$i]=chr(rand($rand_array[$tt][0],$rand_array[$tt][1]));
}
imagettftext($img, 18, rand(-10,10), rand(1,10), rand(20,30), $text_color, $font, $rand_num[0]);
imagettftext($img, 18, rand(-30,30), rand(15,30), rand(20,30), $text_color, $font, $rand_num[1]);
imagettftext($img, 18, rand(-30,30), rand(35,60), rand(20,30), $text_color, $font, $rand_num[2]);
imagettftext($img, 18, rand(-30,30), rand(65,70), rand(20,30), $text_color, $font, $rand_num[3]);
imagepng($img);
imagedestroy($img);
$str=implode("", $rand_num);
session_start();
$_SESSION['validate']=$str;
?>