网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 dedecms注册中文会员无法打开空间的解决方法
内容
    解决中文注册的会员空间打不开问题,这个问题我也很苦恼,不过还是被解决了。
    其实说到底还是个字符编码转换问题。
    因为汉字没有在判断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);
    问题解决。
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/12/16 3:36:13