两台服务器上的配置是一样的,但相同的程序确一个能显示,一个不能显示如下地址http://www.cqmjh.com/guestbook/new.php?Lang=gb (正常显示)http://site.foway.com/yuefun/index0.htm??
两台服务器上的配置是一样的,但相同的程序确一个能显示,一个不能显示如下地址http://www.cqmjh.com/guestbook/new.php?Lang=gb (正常显示)http://site.foway.com/yuefun/index0.htm??
http://site.foway.com/yuefun/conf/check_imgcode.php我重新写了个程序,现在总算好了客户真TMD烦呀给装了个mbstring库,就出错了主要是有几个函数不能用
代码如下,正常情况下都能运行的代码一:
<?
$text = "Uk456";//随机产生$size = 18;
$color = "#000000";
$color_1 = substr($color,0,2);
$color_2 = substr($color,2,2);
$color_3 = substr($color,4,2);
$text_len = strlen($text);
$show_text = "";
for($i=0;$i<$text_len;$i++)
{
$show_text .= substr($text,$i,1)." ";
}
$img_height= $size*1.4;$bg_file ="../conf/check_bg.png";
$imginfo = @getimagesize($bg_file);
$img_h = $imginfo[1];$img_y = 17;
$img_x = 8;//新建图象
$pic=@imagecreatefrompng("".$bg_file."");//定义黑白颜色
$black=imagecolorallocate($pic,0,0,0);
$white=imagecolorallocate($pic,hexdec($color_1),hexdec($color_2),hexdec($color_3));
$bg =imagecolorallocate($pic,20,50,100);//定义字体
$font="../conf/UPCJB.TTF";//字体库 //写 TTF 文字到图中
@imagettftext($pic,$size,0,$img_x,$img_y,$white,$font,$show_text); //建立 GIF 图型
@imagepng($pic); //结束图形,释放内存空间
imagedestroy($pic); ?>==========================================================================
代码二:
<?
$text = "Uk456";//随机产生$im = @imagecreate(60, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 233, 233, 233);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 120, 0, 0, $text, $text_color);
imagepng($im);
imagedestroy($im);
?>现在代码二可以正常运行
以前代码一也可以运行的
当前GD库支持函数可见
http://site.foway.com/yang/pwd.php
共有79个,而我本地为81个
应该是函数不支持的原因大家再来谈谈各自的想法