这段PHP代码是否有问题?

来源:百度知道 编辑:UC知道 时间:2024/06/05 00:22:30
#[加载模板配置]
$set = array
(
"tplid"=>1,
"tpldir"=>"admin/tpl",
"cache"=>"data/admin_tplc",
"phpdir"=>"",
"ext"=>"htm",
"autorefresh"=>true,
"autoimg"=>true
);
require_once("class/tpl.class.php");
$TPL = new QG_C_TEMPLATE($set);
$TPL->set($set["tplid"],"tplid");
$TPL->set($set["tpldir"],"tpldir");
$TPL->set($set["cache"],"cache");
$TPL->set($set["phpdir"],"phpdir");

#[获取get或post到的变量,并附新值]
$sysfile = $sys_file = $sysFile = SafeHtml($file);
$sysact = $sys_act = $sysAct = SafeHtml($act);

#[判断加载的code]
if($isCheckCode && function_exists("imagecreate") && $sys_act == "chkcode")
{
ob_clean();
SetCheckCodes();<

这段代码本身没什么问题!
显示乱码应该是你文件编码的问题,你把你的php脚本文件,html文件都另存为utf8格式,然后在html文件里的,或者tpl文件里的charset设置为utf8,将数据库也设置成utf8,应该就没什么问题了!

做东西和开发的时候编码一定得统一,如果是出现乱码,解决方法就得去找找看你的编码问题了