濮阳杆衣贸易有限公司

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

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

POST TIME:2020-04-04 13:30

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

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

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

保存為bom.php放于網(wǎng)站根目錄 執(zhí)行一下 就可以了
<?php
//remove the utf-8 boms
if (isset($_GET['dir'])){ //要去除的文件目錄,無參數(shù)則為文件當前目錄。
$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
龙江县| 玛曲县| 晴隆县| 临洮县| 方山县| 观塘区| 同心县| 正安县| 鞍山市| 双辽市| 格尔木市| 开封市| 镇安县| 姜堰市| 彝良县| 柳林县| 宁乡县| 潞城市| 吴川市| 聂荣县| 牟定县| 阿拉善盟| 达拉特旗| 偏关县| 涿鹿县| 延庆县| 白玉县| 普洱| 黔南| 兖州市| 枝江市| 三明市| 长阳| 武宣县| 邮箱| 都江堰市| 庆安县| 嘉善县| 綦江县| 靖边县| 高碑店市|