RT.
谢谢各位路过的大虾、女虾们。jpg.gif.png.bmp的图片都随便。图片就好了谢谢,需要支持中文。本来做了一点、可惜只能用与 英文.
谢谢各位路过的大虾、女虾们。jpg.gif.png.bmp的图片都随便。图片就好了谢谢,需要支持中文。本来做了一点、可惜只能用与 英文.
解决方案 »
- 关于discuz的问题
- 关于MySQL的update问题,急. 谢谢大家啊
- 放2个函数,ArrayToString , ArrayToPhp
- document.write中的内容包含了script 该如何处理
- 主机不能识别COOKIE?
- 怪!ecshop的注册时间怎么是int数据类型?
- 用PDO调用oracle存储过程,返回参数为游标,怎么提取数据
- DESTOON后台管理界面,5、6秒左右不操作就变白屏
- 关于Laravel 4在ubuntu上的安装
- 点击一个按钮,实现将多张图片打包下载,需要有提示那种,就是提示将打包文件放到什么目录的那种,求指导
- 中文url 编码转换问题
- linux mbstring.so
header("Content-type: image/gif");
$im =imagecreate(800,150);
$background_color = ImageColorAllocate ($im, 255, 255, 255);
$time = date("Y-m-d H:i");
//以上为获取系统时间,如果要加个秒,里面的写成Y-m-d H:i:s这个你英语知道的,一看便知道怎么回事了。
$col = imagecolorallocate($im, 0, 51, 102);
$font="C:/WINDOWS/Fonts/simsun.ttc";
//我将要使用的字体放同目录下
$come=iconv("gb2312","utf-8","现在时间是:".$time);
//写 TTF 文字到图中
imagettftext($im,15,0,10,18,$col,$font,$come);
imagegif($im);
imagedestroy($im);
?>
session_start();
header("Content-Type:image/gif");
session_register("safeCode");$im = imagecreate(60,20);
$bgColor = imagecolorallocate($im,255,255,255);
$fontColor = imagecolorallocate($im,0,0,0);
$code = '';imagefill($im,0,0,$bgColor);$sample = "abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ123456789123456789123456789123456789123456789";for($i=0;$i<4;$i++){
$codey = substr($sample,mt_rand(0,92),1);
imagettftext($im,18,mt_rand(-20,20),3+($i*12),18,$fontColor,"ARIAL.TTF",$codey);
$code .=$codey;
}for($i=0;$i<100;$i++){
$dianColor = imagecolorallocate($im,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));
imagesetpixel($im,mt_rand(0,60),mt_rand(0,60),$dianColor);
}for($i=0;$i<4;$i++){
$xianColor = imagecolorallocate($im,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));
imageline($im,mt_rand(0,60),mt_rand(0,20),mt_rand(0,60),mt_rand(0,20),$dianColor);
}$code=strtoupper($code);
$_SESSION['safeCode'] = $code;
imagegif($im);
imagedestroy($im);
?>
<img src = 'safecode.php'>