CNET中国旗舰网站

ZDNet China | CNET科技资讯网 | 政府采购 | 行业网站联盟





 
标题: [求助] 前辈们近来帮看下,谢谢 !
大黄蜂
支柱会员
Rank: 10Rank: 10Rank: 10



UID 319163
精华 5
积分 17513
帖子 1256
威望 8124
ZD币 1987 元
阅读权限 210
注册 2008-4-15
状态 离线
  楼主
发表于 2008-4-23 13:25  资料  个人空间  短消息  加为好友 
开发者在线

前辈们近来帮看下,谢谢 !

这个是第一个文件.   index.asp   
  为什么我点添加就是保存,那个联系人的内容也获取不到.等,大虾们帮看下,谢谢了!   
  <%@LANGUAGE="VBSCRIPT"   CODEPAGE="936"%>   
  <!--#include   file="conn.asp"   -->   
  <!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"   c   />   
  <title>留言版</title>   
  </head>   
   
  <body   topmargin="0">   
  <table   cellpadding="0"   cellspacing="0"   border="1"   width="960"   height="550"   align="center"   background="image/dp.jpg">   
    <form   action="add.asp"   method="post"   name=form1>     
  <tr>   
  <td   width="150"> </td>   
      <td   width=660"   align="center">   
      <table   width="660"   height="61%"   border="0"   align="center"   >   
        
   
      <tr><td   height="20"> </td>   
      </tr>     
        
      <tr><td   height="50"><div   align="center"><font   size="6"   color="#FF0000">留言版</font></div></td>   
      </tr>     
      <tr><td   height="250"><table   width="100%"   height="100%"   border="1">   
            
              <tr   >   
                  <td   height="25"   ><font   size="4"   color="#000000">标题</font></td>   
                  <td   height="25"><div   align="left">   
                      <input   name="text"   type="text"   size="25"   />   
                  </div></td>   
              </tr>   
              <tr>   
                  <td   height="25"><font   size="4"   color="#000000">联系人</font></td>   
                  <td><div   align="left">   
                      <input     name="lianxi"   type="lianxi"   id="lianxi"   size="25"/>   
                  </div></td>   
              </tr>   
              <tr>   
                  <td   height="100"><font   size="4"   color="#000000">内容</font></td>   
                  <td><div   align="left">   
                      <textarea   name="body"   cols="40"   type="body"   rows="10"></textarea>   
                  </div></td>   
              </tr>   
      <tr><td> </td><td   >            
          <div   align="left">   
              <input   type="submit"   name="submit"   value="确     定">   
              </div></td></tr>   
            
      </table></td>   
      </tr>     
      <hr>   
      <tr><td   height="200"><table   width="100%"   height="100%">   
      <%     
        sql="select   *   from   mail   order   by   ID   desc"   
        set   rs=server.createobject("adodb.recordset")   
        rs.open   sql,conn,1,1   
      %>   
        <%   if   rs.eof   then     
  Response.Write"没有留言!"     
  else   
  %>   
                                                                  <%   do   while   not   rs.eof   %>   
                                                                  <tr>     
                                                                      <td><%=rs.title%></td>   
                                                                  </tr>   
  <tr>     
                                                                      <td><%=rs.name%></td>   
                                                                  </tr>   
  <tr>     
                                                                      <td><%=rs.body%></td>   
                                                                  </tr>   
  <tr><td><%=rs.data%></td>   
  </tr>   
                                                                  <%   rs.movenext     
  loop   
      %>   
      <%   end   if   %>   
                                                                  <%   rs.close     
  set   rs=nothing   
  %></table></td>   
      </tr>     
      </table>   
    </td>   
    <td   width="150"> </td></tr>   
  </tr>     
  </form>   
  </table>   
   
   
   
  </body>   
  </html>   
   
  添加文件是   add.asp   
   
  <%   
  dim   conn,sql,con   
  set   conn=server.CreateObject("adodb.connection")   
  con="Provider=Microsoft.Jet.OLEDB.4.0;Data   Source="   &   server.MapPath("db.mdb")   
          conn.Open   con     
    dim   text,body,lianxi,data_up   
  text=request.Form("text")   
  body=request.Form("body")   
  lianxi=request.Form("lianxi")   
  data_up=now()   
  sql="insert   into   mail(text,body,[lianxi],data_up)   values('"&text&"','"&body&"','"&lianxi&"','"&data&"')"   
  response.write   (sql)   
  conn.execute(sql)   
  Response.Write"<script   language='javascript'>alert('添加成功!')</script>"   
  'response.redirect   "index.asp"   
   
  %>




顶部
 



当前时区 GMT+8, 现在时间是 2009-7-4 12:44

  Powered by Discuz! 5.5.0 © 2001-2007 Comsenz Inc.
Processed in 0.073241 second(s), 3/3 queries

清除 Cookies - 联系我们 - ZDNetChina中文社区 - 无图版