校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 網站建設 > 建站知識 > dede驗證碼不顯示最終解決方法

dede驗證碼不顯示最終解決方法

POST TIME:2020-04-04 13:30

排除gd2和權限問題后還是不顯示

那么一定是bom問題 存在于dede utf8版本中

用下面的程序 批量處理即可

保存為bom.php放于網站根目錄 執行一下 就可以了
<?php
//remove the utf-8 boms
if (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.</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);
}
?>


收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 湛江市| 隆德县| 浦城县| 承德县| 汉阴县| 呈贡县| 宿迁市| 新民市| 东丰县| 黄陵县| 拜泉县| 昌图县| 内黄县| 长宁县| 南丰县| 通城县| 来凤县| 定南县| 峨山| 疏勒县| 盐池县| 陕西省| 新安县| 洛川县| 灯塔市| 溧阳市| 普安县| 新民市| 安徽省| 蒙阴县| 绍兴市| 太保市| 固阳县| 广州市| 芜湖市| 张家港市| 肇东市| 邮箱| 浦东新区| 玛沁县| 宜兰市|