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

主頁 > 網站建設 > 建站知識 > 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
主站蜘蛛池模板: 甘孜县| 泾川县| 启东市| 德江县| 百色市| 堆龙德庆县| 和田市| 娱乐| 宁陵县| 施秉县| 长泰县| 蕲春县| 乃东县| 乌审旗| 黄平县| 浦县| 辽源市| 博湖县| 株洲县| 衡水市| 康乐县| 新建县| 旬邑县| 阿拉善右旗| 石阡县| 凤凰县| 湟源县| 伊吾县| 西贡区| 达拉特旗| 醴陵市| 德州市| 青阳县| 遵化市| 新泰市| 湖南省| 行唐县| 阿克| 洱源县| 日喀则市| 百色市|