天天看点

dede网站搬家及gbk系统配置参数无法保存文字

问题一织梦网站搬家流程:

  1. 登录网址后台_数据库备份/还原_全选提交(备份表结构信息)s说明:这里登录ftp,你会发现/data/backupdata/下面的文件在变化,直到后台'提示数据库备份完成'
  2. ftp或者宝塔下载网站源文件保存到你指定的位置,推荐使用宝塔文件压缩下载相比较ftp更快
  3. 把下载的文件上传到你新的空间上
  4. 在这里也不知道对不啦,反正我这样操作的/就是你下的网站文件如果没有install文件怎么办,是不是没法域名/install/index.php了?笨办法,到官方网站上下载一个集成包,这里分为gbk和utf-8
  5. 然后织梦正常流程安装界面操作即可,其实和这个差不多了,当然后台登录界面可能没人家好看http://www.dede58.com/a/dedeaz/15064.html
  6. 安装完成后,登录你的后台,找到系统_数据库备份/还原_点击右上角"数据还原"
  7. 下面点击系统基本参数,输入网站名称,站点根网址绑定你的域名,然后了?还有啥,这个点击生成更新你的栏目文档主页/一键更新网站/更新系统缓存,然后做下织梦安全防护就没了

问题二织梦网站首页的index.html如何去除推荐以下2个网址看完操作下

  • 如何将DEDE织梦网站首页的index.html去掉
  • 三种方法教你怎么去掉织梦dedecms首页网址后面的index.html
其实总结来说就是系统参数绑定好站点根网址然后了宝塔默认面板index.html提前,如果以上都做了还不行,在你的.htaccess配置文件中输入以下语句 DirectoryIndex index.html index.php index.htm最后生成,浏览器清除下缓存下即可!

不容易,边扯边回想.终于要说到我想说的了!这个织梦系统配置参数无法填汉字怎么办?

事件起因:网站搬家后出现问题,①后台系统基本参数出现乱码,不用说肯定这个集成包里面的install文件与网站源文件不相符,不是同一种编码!删了,重装;②更换官网上下载的文件另外一种编码的,重新搬家,ok,无语的是后台系统基本参数输入文字无法保存,英文数字是可以,可这不是目的,删了,重新安装③忘记说明出现这种情况是gbk编码的集成包的专利,其他的享受不了这个待遇;既然这个编码的文件是gbk的,那么我在安装的时候是不是要那啥?就是mysql也是这个gbk格式?不知道,试试呗,结果和②是一样的;④怎么办?实在不行就utf-8的,好歹能用不是,乱码就乱码呗,以后有方法在处理改过来下,然而还是无法保存,反正当时可郁闷,怎么办?怎么办?这个着急呀,再加上天热,算了,出去抽更烟冷静下⑤回来后,度娘呀!好吧,忘了,左查右查, 也没找到,心里难过不行,你难道我净遇到这种奇葩问题,看了下之前的老网站,没毛病呀,不能够呀!黄天不负有心人,结果是找到了,织梦系统配置参数无法填汉字怎么办然后看的有些懵,不是很懂呀!直接更改源文件,界面直接乱码,怎么办,删⑥首先把下载地install文件里面要修改的处理下,然后再次重新上传,一步步安装,还原生成,苍天,好了!

总结:找到/dede/templets/sys_info.htm,然后用查找htmlspecialchars($row['value']) 将其修改为htmlspecialchars(($row['value']), ENT_COMPAT ,'GB2312')修改好过后保存;要注意的是htmlspecialchars($row['value'])有两个,两个都要替换成htmlspecialchars(($row['value']), ENT_COMPAT ,'GB2312');如果以上方法不行,那么就要考虑是不是你的PHP版本问题,一定要看一下本地环境的PHP和,服务器上的PHP环境版本是不是一样的,如果不一样也会出现这个问题。

sys_info文件代码展示

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> <title>系统配置参数</title> <script language="javascript" src="../include/js/dedeajax2.js"></script> <script language="javascript" src="../include/js/jquery/jquery.js"></script> <script language="javascript"> var searchconfig = false; function Nav() { if(window.navigator.userAgent.indexOf("MSIE")>=1) return 'IE'; else if(window.navigator.userAgent.indexOf("Firefox")>=1) return 'FF'; else return "OT"; } function $Obj(objname) { return document.getElementById(objname); } function ShowConfig(em,allgr) { if(searchconfig) location.reload(); for(var i=1;i<=allgr;i++) { if(i==em) $Obj('td'+i).style.display = (Nav()=='IE' ? 'block' : 'table'); else $Obj('td'+i).style.display = 'none'; } $Obj('addvar').style.display = 'none'; } function ShowHide(objname) { var obj = $Obj(objname); if(obj.style.display != "none") obj.style.display = "none"; else obj.style.display = (Nav()=='IE' ? 'block' : 'table-row'); } function backSearch() { location.reload(); } function getSearch() { var searchKeywords = $Obj('keywds').value; var myajax = new DedeAjax($Obj('_search')); myajax.SendGet('sys_info.php?dopost=search&keywords='+searchKeywords) $Obj('_searchback').innerHTML = '<input name="searchbackBtn" type="button" value="返回" id="searchbackBtn" onclick="backSearch()"/>' $Obj('_mainsearch').innerHTML = ''; searchconfig = true; } function resetCookieEncode() { jQuery.get("sys_info.php?dopost=make_encode", function(data){ jQuery("#edit___cfg_cookie_encode").val(data); }); } </script> <link href="css/base.css" target="_blank" rel="external nofollow" rel="stylesheet" type="text/css"> </head> <body background='images/allbg.gif' leftmargin='8' topmargin='8'> <div style="min-width:780px"> <table width="98%" cellpadding="2" cellspacing="1" bgcolor="#D6D6D6" align="center"> <tr> <td height="28" background="images/tbg.gif" style="padding-left:10px;"><b>DedeCMS系统配置参数:</b></td> </tr> <tr> <td height="24" bgcolor="#ffffff" align="center"><?php $ds = file(DEDEADMIN.'/inc/configgroup.txt'); $totalGroup = count($ds); $i = 0; foreach($ds as $dl) { $dl = trim($dl); if(empty($dl)) continue; $dls = explode(',',$dl); $i++; if($i>1) echo " | <a href='javascript:ShowConfig($i,$totalGroup)'>{$dls[1]}</a> "; else{ echo " <a href='javascript:ShowConfig($i,$totalGroup)'>{$dls[1]}</a> "; } } ?> | <a href="#" target="_blank" rel="external nofollow" onClick="ShowHide('addvar')">添加新变量</a></td> </tr> <tr id="addvar" style="display:none"> <td height="24" bgcolor="#ffffff" align="center"><form name="fadd" action="sys_info.php" method="post"> <input type='hidden' name='dopost' value='add'> <table width="98%" cellspacing="0" cellpadding="0"> <tr> <td width="12%" height="26">变量名称:</td> <td width="38%" align="left"><input name="nvarname" type="text" id="nvarname" class="npvar" style="width:80%" /></td> <td width="12%" align="center">变量值:</td> <td width="38%" align="left"><input name="nvarvalue" type="text" id="nvarvalue" class="npvar" style="width:80%" /></td> </tr> <tr> <td width="10%" height="26">变量类型:</td> <td colspan='3' align="left"><input name="vartype" type="radio" value="string" class='np' checked='checked' /> 文本 <input name="vartype" type="radio" value="number" class='np' /> 数字 <input type="radio" name="vartype" value="bool" class='np' /> 布尔(Y/N) <input type="radio" name="vartype" value="bstring" class='np' /> 多行文本 </td> </tr> <tr> <td height="26">参数说明:</td> <td align="left"><input type="text" name="varmsg" id="varmsg" class="npvar" style="width:80%" /></td> <td align="center">所属组:</td> <td align="left"><?php echo "<select name='vargroup' class='npvar'> "; foreach($ds as $dl){ $dl = trim($dl); if(empty($dl)) continue; $dls = explode(',',$dl); echo "<option value='{$dls[0]}'>{$dls[1]}</option> "; } echo "</select> "; ?> <input type="submit" name="Submit" value="保存变量" class="np coolbg" /></td> </tr> </table> </form></td> </tr> </table> <table width="98%" cellpadding="0" cellspacing="0" style="margin-top:10px" bgcolor="#D6D6D6" align="center"> <tr> <td height="28" align="right" background="images/tbg.gif" style="border:1px solid #cfcfcf;border-bottom:none;">   配置搜索: <input type="text" name="keywds" id="keywds" /> <input name="searchBtn" type="button" value="搜索" id="searchBtn" onclick="getSearch()"/>  <span id="_searchback"></span></td> </tr> <tr> <td bgcolor="#FFFFFF" width="100%"><form action="sys_info.php" method="post" name="form1"> <input type="hidden" name="dopost" value="save"> <div id="_search"></div> <div id="_mainsearch"> <?php $n = 0; if(!isset($gp)) $gp = 1; foreach($ds as $dl) { $dl = trim($dl); if(empty($dl)) continue; $dls = explode(',',$dl); $n++; ?> <table width="100%" style='<?php if($n!=$gp) echo "display:none"; ?>' id="td<?php echo $n?>" cellspacing="1" cellpadding="1" bgcolor="#cfcfcf"> <tr align="center" bgcolor="#FBFCE2" height="25"> <td width="300">参数说明</td> <td>参数值</td> <td width="220">变量名</td> </tr> <?php $dsql->SetQuery("Select * From `dhnsysconfig` where groupid='{$dls[0]}' order by aid asc"); $dsql->Execute(); $i = 1; while($row = $dsql->GetArray()) { if($i%2==0) { $bgcolor = "#F9FCEF"; } else { $bgcolor = "#ffffff"; } $i++; ?> <tr align="center" height="25" bgcolor="<?php echo $bgcolor?>"> <td width="300"><?php echo $row['info']; ?>: </td> <td align="left" style="padding:3px;"><?php if($row['type']=='bool') { $c1=''; $c2 = ''; $row['value']=='Y' ? $c1=" checked" : $c2=" checked"; echo "<input type='radio' class='np' name='edit___{$row['varname']}' value='Y'$c1>是 "; echo "<input type='radio' class='np' name='edit___{$row['varname']}' value='N'$c2>否 "; }else if($row['type']=='bstring') { echo "<textarea name='edit___{$row['varname']}' row='4' id='edit___{$row['varname']}' class='textarea_info' style='width:98%;height:50px'>".htmlspecialchars(($row['value']), ENT_COMPAT ,'gb2312')."</textarea>"; }else if($row['type']=='number') { echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value='{$row['value']}' style='width:30%'>"; }else { $addstr=''; if ($row['varname']=='cfg_cookie_encode') { $addstr=' <a href="javascript:resetCookieEncode();" target="_blank" rel="external nofollow" style="color:blue">[重新生成]</a>'; } echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value="".htmlspecialchars(($row['value']), ENT_COMPAT ,'gb2312')."" style='width:80%'>{$addstr}"; } ?></td> <td><?php echo $row['varname']?></td> </tr> <?php } ?> </table> <?php } ?> </div> <table width="100%" cellspacing="1" cellpadding="1" style="border:1px solid #cfcfcf;border-top:none;"> <tr bgcolor="#F9FCEF"> <td height="50" colspan="3"><table width="98%" cellspacing="1" cellpadding="1"> <tr> <td width="11%"> </td> <td width="11%"><input name="imageField" type="image" src="images/button_ok.gif" width="60" height="22" class="np"></td> <td width="78%"><img src="images/button_reset.gif" width="60" height="22" style="cursor:pointer" onClick="document.form1.reset()"></td> </tr> </table></td> </tr> </table> </form></td> </tr> </table> </div> </body> </html>