首页>技术知识>帝国CMS 帝国CMS网站验证码不显示的有效解决方法
帝国CMS教程
2021-08-20
1、帝国CMS网站GD库没有打开一般的虚拟主机都会将GD库打开的,如果GD库没有打开,那么访问http://…/e/showkey/index.php就会出现一堆乱码,可以告知空间提供商让他们帮助

1、帝国CMS网站GD库没有打开

一般的虚拟主机都会将GD库打开的,如果GD库没有打开,那么访问http://…/e/showkey/index.php就会出现一堆乱码,可以告知空间提供商让他们帮助开启,如果是自己的主机,那么打开php.ini找到extension=php_gd2.dll将前面的“;”号去掉,重启APACHE或IIS就可以,以前的PHP版本是extension=php_gd.dll。或者你可以将以下代码另存为php文件传到你空间里,如果有GD标题就说明开启了GD库

 

2、帝国批量去掉BOM头代码,新建一个bom.php放入根目录,然后访问http://域名/bom.php即可

<?phpif (isset($_GET['dir'])){ //设置文件目录$basedir=$_GET['dir'];}else{$basedir = '.';}$auto = 1;checkdir($basedir);function checkdir($basedir){if ($dh = opendir($basedir)) {while (($file = readdir($dh)) !== false) {if ($file != '.' && $file != '..'){if (!is_dir($basedir."/".$file)) {echo "filename: $basedir/$file ".checkBOM("$basedir/$file")." <br>";}else{$dirname = $basedir."/".$file;checkdir($dirname);}}}closedir($dh);}}function checkBOM ($filename) {global $auto;$contents = file_get_contents($filename);$charset[1] = substr($contents, 0, 1);$charset[2] = substr($contents, 1, 1);$charset[3] = substr($contents, 2, 1);if (ord($charset[1]) == 239 && ord($charset[2]) == 187 && ord($charset[3]) == 191) {if ($auto == 1) {$rest = substr($contents, 3);rewrite ($filename, $rest);return ("<font color=red>BOM found, automatically removed._<a href=http://www.lol9.cn>http://www.lol9.cn</a></font>");} else {return ("<font color=red>BOM found.</font>");}}else return ("BOM Not Found.");}function rewrite ($filename, $data) {$filenum = fopen($filename, "w");flock($filenum, LOCK_EX);fwrite($filenum, $data);fclose($filenum);}?>

 

显示全部内容...