主题:无法通过表单,将数据写入数据库,请高手指点看看代码到底那里出错了。谢谢
<form name="form1" method="post" action="booksave.asp">
<table width="770" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="277"><div align="center">作者:
<input name="name" type="text" id="name"height="19">
</div></td>
<td width="294"><div align="center">邮箱:
<input name="eamil" type="text" id="eamil"height="19">
</div></td>
<td width="199"><div align="center">
<input name="tjly" type="submit" id="tjly" value="提交留言">
<a name="xieliuyan"></a></div></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
<textarea name="content" cols="107" rows="5" id="content"></textarea>
</form>
点击提交留言按钮后打开 booksave.asp
booksave.asp代码如下:
<%@LANGUAGE="VBScript" codepage="936"%>
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sql="select name,time,email,content,from liuyan"
rs.open sql,conn,1,3
rs.addnew
name=request.form("name")
email=request.form("email")
content=request.form("content")
rs("name")=name
rs("email")=email
rs("content")=content
rs.update
rs.close
set rs=nothing
conn.close
set rs=nothing
%>
<html>
<head>
<title>留言成功</title>
<meta http-equiv="refresh" c>
<style type="text/css">
<!--
body {
#Layer1 {
position:absolute;
left:323px;
top:53px;
width:234px;
height:101px;
z-index:1;
}
.STYLE1 {
font-size: 16px;
font-family: "黑体";
}
-->
</style></head>
<body>
<div id="Layer1">
<p align="center" class="STYLE1">添加成功,2秒钟后自动跳转到</p>
<p align="center" class="STYLE1"><a href="book.asp">留言本首页</a></p>
</div>
<div align="center"></div>
</body>
</html>
可是,总是不能将留言数据插入进数据库,请高手指点一下 ,我到底那里错了.