| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1289 人关注过本帖
标题:急急!!!在线等候!!!
只看楼主 加入收藏
xiaoyangyjs
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2007-11-29
收藏
 问题点数:0 回复次数:16 
急急!!!在线等候!!!
有人告诉我他错在哪里吗
<style type="text/css">
<!--
.font {
    font-size: 9px;
}
.STYLE1 {font-size: 9pt}
.style4 {color: #FF0000}
-->
</style>
<!--#include file="conn.asp"-->
<%
if request.Form("submit")<>"" then
title=request.form("title")
email=request.form("email")
url=request.form("url")
lianxi=request.form("lianxi")
bodys=request.form("bodys")
set ly=server.createobject("adodb.recordset")
ly.open "select * from liuyan",conn,1,3
ly.addnew
ly("title")=title
ly("email")=email
ly("url")=url
ly("lianxi")=lianxi
ly("bodys")=bodys
ly.update
end if
%>
<body>
<!--#include file="head.htm"-->
<table width="778" border="0" align="center">
  <tr>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
  </tr>
  <tr>
    <td><table width="778" border="0" align="center" cellspacing="2" bgcolor="#CCCCCC">
      <tr bgcolor="#F3F3F3">
        <td width="10%" class="STYLE1">NO<font color="#000000">:<%=ly("id")%></font></td>
        <td width="10%" align="right" class="STYLE1">姓名<font color="#000000">:</font></td>
        <td> </td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td colspan="2" align="right" class="STYLE1" width="20%">主题<font color="#000000">:</font></td>
        <td><%=ly("title")%></td>
      </tr>
      <tr bgcolor="#F3F3F3">
        <td height="90" colspan="2" align="right" class="STYLE1" width="20%">留言内容<font color="#000000">:</font></td>
        <td><%=ly("bodys")%></td>
      </tr>
    </table><br>
    </td>
  </tr>
  <tr>
    <td><form action="" method=post name="form1">
      <table width="778" height="254" border="0" align="center" cellspacing="2" bgcolor="#CCCCCC">
        <tr bgcolor="#F3F3F3">
          <td  width="20%" align=right><span class="STYLE1"><font color="#000000">您的姓名:</font></span></td>
          <td>        </tr>
        <tr bgcolor="#F3F3F3">
          <td   width="20%" align=right bgcolor="#F3F3F3"><span class="STYLE1"> <span class="style4">*</span> 留言主题:</span></td>
          <td ><span class="STYLE1">
            <input name="title" type=text id="title" size="30"  maxlength=50 >
            <span class="style4">* 必须填写(字以内)</span></span></td>
        </tr>
        <tr bgcolor="#F3F3F3">
          <td   width="20%" align=right><span class="STYLE1"><span class="style4">*</span> 您的邮箱:</span></td>
          <td ><input name="email" type="text" id="email" size="30"  maxlength="50">         
          </tr>
        <tr bgcolor="#F3F3F3">
          <td   width="20%" align=right><span class="STYLE1">您的网站:</span></td>
          <td><input name="url" type=text value="http://" size="30"  maxlength=100></td>
        </tr>
        <tr bgcolor="#F3F3F3">
          <td   width="20%" align=right><span class="STYLE1">其它联系方式:</span></td>
          <td><span class="STYLE1">
            <input name="lianxi" type=text id="lianxi" value="" size="30"  maxlength=100>
            (如QQ、MSN等)</span></td>
        </tr>
        <tr bgcolor="#F3F3F3">
          <td   width="20%" align=right><span class="STYLE1"><span class="style4">*</span> 留言内容:<br>
            <font color=red>(100字以内)</font></span></td>
          <td><span style="font-size: 9pt">
            <textarea name="bodys" cols="66" rows="7" id="bodys"></textarea>
          </span></td>
        <tr bgcolor="#F3F3F3">
          <td colSpan="2"><div align="center" class="STYLE1">
              <input type="submit" value="提交留言" name="Submit" onClick="return checked()">
              <input type="reset" value="重新填写" name="Submit2">
          </div></td>
        </tr>
      </table>
    </form></td>
  </tr>
  <tr>
    <td> </td>
  </tr>
</table>
<!--#include file="foot.htm"-->
</body>
<script language="javascript">
function checked()
{
if(document.form1.title.value=="")
{
document.form1.title.focus();
alert('标题为空!!');
return false;
}
if(document.form1.email.value=="")
{
document.form1.email.focus();
alert('邮箱为空!!');
return false;
}
if(document.form1.bodys.value=="")
{
document.form1.bodys.focus();
alert('内容为空!!');
return false;
}
}
</script>
</html>


我看不出来,这是服务器报错的
错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: 'ly'
/web/liuyan.asp, 第 41 行
也就是这一行 <td width="10%" class="STYLE1">NO<font color="#000000">:<%=ly("id")%></font></td>
帮帮忙,我在线等????
搜索更多相关主题的帖子: color email liuyan include css 
2008-01-07 20:06
不惑
Rank: 2
等 级:论坛游民
威 望:2
帖 子:569
专家分:13
注 册:2007-3-22
收藏
得分:0 
晕,不会把第41行给标出来的说.
我没功夫看
2008-01-07 20:52
xiaoyangyjs
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2007-11-29
收藏
得分:0 
我把那一行写在下面了,不过谢谢你回帖啊,现在这个问题解决了,可javascript好像没有运行啊,可以帮我再看一下吗?劳驾?不甚感激!!!!
2008-01-07 21:13
不惑
Rank: 2
等 级:论坛游民
威 望:2
帖 子:569
专家分:13
注 册:2007-3-22
收藏
得分:0 
晕.你在这之前
set ly=server.createobject("adodb.recordset")
ly.open "select * from liuyan",conn,1,3
ly.addnew
ly("title")=title
ly("email")=email
ly("url")=url
ly("lianxi")=lianxi
ly("bodys")=bodys
ly.update
你增加了一行,这时id已有变化
如果你还要用ly请再一次地打开吧
2008-01-07 21:19
xiaoyangyjs
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2007-11-29
收藏
得分:0 
没有这样的吧,我把那添加的放在了if的后面,现在已经解决了,我现在想知道我的javascipt那一段代码为什么没有动行呢???
<!--#include file="foot.htm"-->
</body>
<script language="javascript">
function checked()
{
if(document.form1.title.value=="")
{
document.form1.title.focus();
alert('标题为空!!');
return false;
}
if(document.form1.email.value=="")
{
document.form1.email.focus();
alert('邮箱为空!!');
return false;
}
if(document.form1.bodys.value=="")
{
document.form1.bodys.focus();
alert('内容为空!!');
return false;
}
}
</script>


 <input type="submit" value="提交留言" name="Submit" onClick="return checked()">
这是提交留言后调用的
2008-01-07 21:24
不惑
Rank: 2
等 级:论坛游民
威 望:2
帖 子:569
专家分:13
注 册:2007-3-22
收藏
得分:0 
第一,指定它放在
</body>
之前试试
然后,它提示是那一行出错啊?
2008-01-07 21:28
xiaoyangyjs
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2007-11-29
收藏
得分:0 
位置我放了好多地方,没有报错,
2008-01-07 21:31
不惑
Rank: 2
等 级:论坛游民
威 望:2
帖 子:569
专家分:13
注 册:2007-3-22
收藏
得分:0 
JS的错误在左下角,你仔细看看
2008-01-07 21:36
xiaoyangyjs
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2007-11-29
收藏
得分:0 
没有错误,我可以添加数据的,也就是说网页中代码没有错误,只是我没有输入的话,我想调用js的,可是没有调用到,比如说我没有写title,应该弹出对话框的,不是吗,可是没有??????
2008-01-07 21:40
不惑
Rank: 2
等 级:论坛游民
威 望:2
帖 子:569
专家分:13
注 册:2007-3-22
收藏
得分:0 
JS出错大多不影响页面的显示的.
只在左下角有一个出错的提示.
你不提示证明你肯定有错
2008-01-07 21:42
快速回复:急急!!!在线等候!!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013833 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved