主頁(yè) > 網(wǎng)站建設(shè) > 建站知識(shí) > dede驗(yàn)證碼不顯示最終解決方法

dede驗(yàn)證碼不顯示最終解決方法

POST TIME:2020-04-04 13:30

排除gd2和權(quán)限問(wèn)題后還是不顯示

那么一定是bom問(wèn)題 存在于dede utf8版本中

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

保存為bom.php放于網(wǎng)站根目錄 執(zhí)行一下 就可以了
<?php
//remove the utf-8 boms
if (isset($_GET['dir'])){ //要去除的文件目錄,無(wú)參數(shù)則為文件當(dāng)前目錄。
$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