注册 登录
编程论坛 ASP技术论坛

数据已经添到数据库 后台也能显示相应数据 但是网站首页看不到相应添加的板块 什么情况?

xiaowu1990 发布于 2014-07-14 22:41, 2091 次点击
网站后台要添加个小设置,于是添加代码如下,数据库能读到数据,然后在后台数据更改之前,按钮显示的也是数据库的内容,但是更改提示修改成功以后,提示成功,数据也入库了,前台还是读不出来,请问是什么情况?估计表达有问题,等上班了贴图,,下面那些各项数据qq电话什么的都能显示出来,只有添加的bumen选项没能显示出来 现在写的代码如下:
程序代码:
sql="select * from IndexInfo where Id=1"
   Set rsn = Server.CreateObject("ADODB.RecordSet")
   rsn.Open sql,conn,1,1
   if not(rsn.eof and rsn.bof) then
    Id=rsn("Id")
    webname=rsn("webname")
    copyright=rsn("copyright")   
    WebTitle=rsn("WebTitle")
    KeyWorks=rsn("KeyWorks")
    Descriptions=rsn("Description")   
    Fax=rsn("fax")
    EMail=rsn("EMail")
    bumen=rsn("bumen")
    '-----------------------
  topTel1=rsn("topTel1")
  topTel2=rsn("topTel2")
  
  tel1=rsn("tel1"):tel2=rsn("tel2"):tel3=rsn("tel3"):tel4=rsn("tel4")
  Mtel1=rsn("Mtel1"):Mtel2=rsn("Mtel2"):Mtel3=rsn("Mtel3"):Mtel4=rsn("Mtel4"):Mtel5=rsn("Mtel5"):Mtel6=rsn("Mtel6")
  QQ1=rsn("QQ1"):QQ2=rsn("QQ2"):QQ3=rsn("QQ3"):QQ4=rsn("QQ4"):QQ5=rsn("QQ5"):QQ6=rsn("QQ6"):QQ7=rsn("QQ7")
  '------------------------------
  ExitTel=rsn("ExitTel")
  IfCopy=rsn("IfCopy")
   end if
   rsn.close()
   set rsn=nothing
%>
<style type="text/css">
<!--
body
{
    margin-left
: 0px;
    margin-top
: 0px;
    margin-right
: 0px;
    margin-bottom
: 0px;
    background-color
: #F8F9FA; font-size:12px;
}
td
{font-size:12px;}
-->
</style>
<script   language="javascript" >
        
        
var   index=<%=indeC%>;
         
        
function append()
        {
        
if(index<=11){
        document.getElementById(
"bjzlNum").value=index;
        document.getElementById(
"div"+index).style.display="block";

        index
++;
        
        }
else{
          alert(
"最多只能添加11个二级导航");
        }

        }
        
        
function shanchu(i){
          document.getElementById(
"DahangLanMu"+i).value="";
          document.getElementById(
"DahangLianjie"+i).value="";
          document.getElementById(
"div"+i).style.display="none";
        }
        
   
</script>
<link href="../images/skin.css" rel="stylesheet" type="text/css" />
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

 
  <tr>
    <td width="17" valign="top" background="../images/mail_leftbg.gif"><img src="../images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="../images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">&nbsp; 基本设置</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="../images/mail_rightbg.gif"><img src="../images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="71" valign="middle" background="../images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="13" valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top">
        
        <table width="98%" border="0" cellpadding="0" cellspacing="0" class="tab">

 
  <form name="form1" method="post" action="admintitlechk.asp?action=mod">
  <tr>
    <td align="right" >网站名称:</td>
    <td ><input type="text" name="webname"  size="30" value='<%=webname%>'>
      &nbsp;网站是否允许复制:
<input type="radio" name="IfCopy"  value="1" <% if IfCopy=True then response.write("checked")%>>
      &nbsp;允许复制
      <input type="radio" name="IfCopy"  value="0" <% if IfCopy=false then response.write("checked")%>>
      &nbsp;不允许复制 </td>
  </tr>
  <tr>
    <td width="14%" align="right" >首页标题:</td>
    <td width="86%" >
      <label>
        <input name="WebTitle" type="text" id="WebTitle" size="80" value='<%=WebTitle%>'>
      </label>    </td>
  </tr>
  <tr>
    <td height="39" align="right" >关键词:<br>
    [keyWords]:    </td>
    <td ><label>
      <input name="KeyWorks" type="text" id="KeyWorks" size="80" value='<%=KeyWorks%>'>
    </label></td>
  </tr>
  <tr>
    <td align="right" >描述:<br>      
      [Description]:</td>
    <td ><label>
      <textarea name="Descriptions" id="Descriptions" cols="45" rows="3" style="width:80%;"><%=Descriptions%></textarea>
    </label></td>
  </tr>
   

 

 
  <tr>
    <td width="14%" align="right" >联系手机:</td>
    <td width="86%" >
        4:<input name="Mtel4" type="text"  value="<%=Mtel4%>">&nbsp;&nbsp;5:
        <input name="Mtel5" type="text"  value="<%=Mtel5%>">&nbsp;&nbsp;6:
        <input name="Mtel6" type="text"  value="<%=Mtel6%>"></td>
  </tr>
  <tr>
     <td align="right">对应QQ号:</td>
     <td > 4:<input name="QQ4" type="text"  value="<%=QQ4%>">&nbsp;&nbsp;5:
        <input name="QQ5" type="text"  value="<%=QQ5%>">&nbsp;&nbsp;6:
        <input name="QQ6" type="text"  value="<%=QQ6%>"></td>
    <input name="QQ7" type="text" value="<%=QQ7%>"></td>
   </tr>
     <tr>
     <td align="right" >公司传真:</td>
     <td >&nbsp; &nbsp; <input name="fax" type="text" value="<%=fax%>">&nbsp;&nbsp;公司邮箱:<input name="EMail" type="text" value="<%=EMail%>">&nbsp;&nbsp;部门:<input name="bumen" type="text" value="<%=bumen%>"></td>   
</tr>
   

  
  

 
   
  
  <tr>
    <td width="14%" align="right" >旅游热线:</td>
    <td width="86%" >
      <textarea name="copyright" id="copyright" style="display:none"><%=copyright%></textarea>
      <iframe id="eWebEditor1" src="/Editor1/ewebeditor.htm?id=copyright&skin=office2003&style=full650" frameborder="0" scrolling="no" width="100%" height="200"></iframe></textarea>
      </td>
  </tr>
  
  
  
  <tr>
    <td height="60" colspan="2" align="center"><label>
      <input type="submit" name="button" id="button" value="提交">
    &nbsp;&nbsp;&nbsp;
    <input type="reset" name="button2" id="button2" value="重置">
    </label></td>
    </tr>
  </form>
</table>
        
        
        
        
          </td>
      </tr>
    </table></td>
    <td background="../images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="../images/mail_leftbg.gif"><img src="../images/buttom_left2.gif" width="17" height="17" /></td>
      <td height="17" valign="top" background="../images/buttom_bgs.gif"><img src="../images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="../images/mail_rightbg.gif"><img src="../images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>

</body>
<%  action=request("action")
  
  webname
=request("webname")
  WebTitle
=request("WebTitle")
  KeyWorks
=request("KeyWorks")
  Descriptions
=request("Descriptions")

 copyright
=request("copyright")

 
  Fax
=request("Fax")
  EMail
=request("EMail")
    bumen
=request("bumen")
  
topTel1
=request("topTel1")
  topTel2
=request("topTel2")
  tel1
=request("tel1"):tel2=request("tel2"):tel3=request("tel3"):tel4=request("tel4")
  Mtel1
=request("Mtel1"):Mtel2=request("Mtel2"):Mtel3=request("Mtel3"):Mtel4=request("Mtel4"):Mtel5=request("Mtel5"):Mtel6=request("Mtel6")
  QQ1
=request("QQ1"):QQ2=request("QQ2"):QQ3=request("QQ3"):QQ4=request("QQ4"):QQ5=request("QQ5"):QQ6=request("QQ6"):QQ7=request("007")
  IfCopy
=request("IfCopy")
  
  
if IfCopy="1" then
     IfCopy
=True
  
else
    IfCopy
=False
  
end if
  
  ExitTel
=""
  

 
  
if action="mod" then  
   
if WebTitle<>"" then
      
call ModInfo()
   
else
       response.Write(
"<script>alert('请输入网站首页标题!');history.go(-1);</script>")
   
end if   
  
end if
sub ModInfo()     
         
set rs=server.CreateObject("adodb.recordset")
        rs.open
"select * from IndexInfo where Id=1",conn,1,3
            rs(
"webname")=webname
            rs(
"WebTitle")=WebTitle
            rs(
"KeyWorks")=KeyWorks
            rs(
"Description")=Descriptions
            
'rs("ExitTel")=ExitTel
            rs("IfCopy")=IfCopy
            rs(
"Fax")=Fax
            rs(
"copyright")=copyright
            rs(
"EMail")=EMail
                rs(
"bumen")=bumen
            
            rs(
"topTel1")=topTel1
            rs(
"topTel2")=topTel2
            rs(
"tel1")=tel1:rs("tel2")=tel2:rs("tel3")=tel3:rs("tel4")=tel4
            rs(
"Mtel1")=Mtel1:rs("Mtel2")=Mtel2:rs("Mtel3")=Mtel3:rs("Mtel4")=Mtel4:rs("Mtel5")=Mtel5:rs("Mtel6")=Mtel6
            rs(
"QQ1")=QQ1:rs("QQ2")=QQ2:rs("QQ3")=QQ3:rs("QQ4")=QQ4:rs("QQ5")=QQ5:rs("QQ6")rs("QQ7")=QQ7
        rs.Update
        rs.Close
        
set rs=nothing
        
    response.Write(
"<script>alert('修改成功');location.href='admintitle.asp'</script>")
   
   
  
end sub
  
%>
3 回复
#2
xiaowu19902014-07-14 22:48
添加的bumen选项 不能在前台显示 ,数据库数据没问题 其他数据比如qq 电话都能显示 只有bumen不可以,请前辈解答一下 不胜感激
#3
hu9jj2014-07-16 14:08
其他的都能正确显示,唯有bumen不能显示。从贴出的代码分析没有发现错误的地方,建议再检查一下字段名会不会有误?记录中是不是有数据?
#4
龙神诺2014-10-16 23:06
谁有办法帮我做个不输验证的后台和终端屏蔽IP
1