原来代码是这样(从网上下载的,我自己不会):
define('IN_PHPMPS', true);
require_once dirname(__FILE__) . '/include/common.php';
$_REQUEST['act'] = $_REQUEST['act'] ? trim($_REQUEST['act']) : '' ;
switch($_REQUEST['act'])
{
case 'show':
$out = decrypt($_REQUEST['num'], $CFG['crypt']);
$hight = strlen($out)*10;
$image = imagecreate($hight, 20);//创建一个大小为 100*20的图片,大小可更改
$bg = imagecolorallocate($image, 255, 255, 255);//定义白色背景和蓝色文字
$textcolor = imagecolorallocate($image, 55, 55, 55);
for($i=0;$i<=128;$i++){
$point_color = imagecolorallocate ($image, rand(0,255), rand(0,255), rand(0,255));
imagesetpixel($image,rand(2,128),rand(2,38),$point_color);
}
imagestring($image, 5, 0, 3, $out, $textcolor);
header("Content-type: image/png");//输出PNG图片
imagepng($image);
break;
case 'chkcode':
session_start();
$_SESSION["chkcode"] = "";
$chkcode = chkcode();//输出PNG格式图片,并返回生成的验证码。
$_SESSION["chkcode"] = $chkcode;
break;
case 'wenzi'
imagettftext($im, 12, 0, 100, 120, $black, $en_font, $en_text);
imagepng($im);
imagedestroy($im);
}
?>
这样中文的时候就生成乱码了。可否直接在后面再加个中文也能生成的"case"这样我好调用,如果不行要怎么做。
大侠·
总共就百来分了,解决了全送上。
字符是gbk .不要贴源码,是说要怎么改现在的代码让它支持中文