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

主頁 > 網站建設 > 建站知識 > dedecms注冊中文會員無法打開空間的解決方法

dedecms注冊中文會員無法打開空間的解決方法

POST TIME:2020-04-02 21:41

解決中文注冊的會員空間打不開問題 
 
這個問題我也很苦惱,不過還是被解決了。大家分享下哈。 
 
其實說到底還是個字符編碼轉換問題。 
 
因為漢字沒有在判斷uid值時出現了錯誤,導致系統無法識別用戶,所以發生了“你訪問的用戶可能已經被刪除!”錯誤 
 
方法是 
在“member\config.php”文件的最后,PHP結束之前添加 isUTF8($str)函數 
 
function isUTF8($str){ 
$length=strlen($str); 
for($i=0;$i<$length;$i++){ 
$high=ord($str{$i}); 
if(($high==0xC0)||($high==0xC1)){ 
return false; 
}elseif($high<0x80){ 
continue; 
}elseif($high<0xC0){ 
return false; 
}elseif($high<0xE0){ 
if(++$i>=$length) 
return true; 
elseif(($str{$i}&"\xC0")=="\x80") 
continue; 
}elseif($high<0xF0){ 
if(++$i>=$length){ 
return true; 
}elseif(($str{$i}&"\xC0")=="\x80"){ 
if(++$i>=$length) 
return true; 
elseif(($str{$i}&"\xC0")=="\x80") 
continue; 
}elseif($high<0xF5){ 
if(++$i>=$length){ 
return true; 
}elseif(($str{$i}&"\xC0")=="\x80"){ 
if(++$i>=$length){ 
return true; 
}elseif(($str{$i}&"\xC0")=="\x80"){ 
if(++$i>=$length) 
return true; 
elseif(($str{$i}&"\xC0")=="\x80") 
continue; 
return false; 
return true; 
 
然后修改“member\index.php”中的代碼:將 
$tmpstr = @gb2utf8($uid); 
$tmpstr2 = @utf82gb($tmpstr); 
if($tmpstr2==$uid) $uid = $tmpstr; 
修改為 
if(!isUTF8($uid)) $uid = @gb2utf8($uid); 
 
問題解決。


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

  • 400-1100-266
主站蜘蛛池模板: 朝阳区| 康乐县| 江油市| 焉耆| 延川县| 皋兰县| 峨眉山市| 汉沽区| 通化市| 金阳县| 曲松县| 中阳县| 崇信县| 彰武县| 桂林市| 新泰市| 陆丰市| 平湖市| 登封市| 松潘县| 科技| 天柱县| 普兰县| 平罗县| 云和县| 阳朔县| 武定县| 梅河口市| 北流市| 六盘水市| 许昌市| 奎屯市| 南充市| 湾仔区| 宜兰市| 仁布县| 化德县| 霍邱县| 兰考县| 凯里市| 上犹县|