每刷新一次就提交一次数据的问题?
我想把添加留言与查看留言弄到一页面中,可以每刷新一次网页数据就自动提交这是什么原因.代码如下:<!--#include file="setup.asp"-->
<!--#include file="inc/check.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=book_name%>--欢迎您好的光临</title>
<link rel="stylesheet" href="inc/style.css">
</head>
<body>
<table border="0" align="center" cellpadding="0" cellspacing="0" width=760>
<tr><td bgcolor=#ffffff><br>
<table width="97%" border="0" align="center" cellpadding="2" cellspacing="1" class="tb">
<tr bgcolor="#ffffff">
<td height=25 align=center>心海留言本程序</td>
</tr>
</table>
<br>
<table width="97%" border="0" align="center" cellpadding="2" cellspacing="1" class="tb">
<tr class="tt">
<td height=20 align=center>-==添加留言==-</td>
</tr>
<tr class="td">
<tbody>
<td valign="top">
<form method=post action="index.asp">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#D6E0EF">
<tr class="td">
<td width=15%> 你的名字:</td>
<td width=35%><input name="username" type="text" size="20"></td>
<td width="50%" rowspan="6" valign="top"><table width="100%" height=176 border="0" cellspacing="1" cellpadding="2" class="tb">
<tr class="tt">
<td height=18 align=center>选择头像</td>
</tr>
<tr class="td">
<td>
<input name="face" type="radio" value="images/face/1.gif" checked><img src="images/face/1.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/2.gif"><img src="images/face/2.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/3.gif"><img src="images/face/3.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/4.gif"><img src="images/face/4.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/5.gif"><img src="images/face/5.gif" width="32" height="32"><br>
<input type="radio" name="face" value="images/face/6.gif"><img src="images/face/6.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/7.gif"><img src="images/face/7.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/8.gif"><img src="images/face/8.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/9.gif"><img src="images/face/9.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/10.gif"><img src="images/face/10.gif" width="32" height="32"><br>
<input type="radio" name="face" value="images/face/11.gif"><img src="images/face/11.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/12.gif"><img src="images/face/12.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/13.gif"><img src="images/face/13.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/14.gif"><img src="images/face/14.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/13.gif"><img src="images/face/15.gif" width="32" height="32"><br>
<input type="radio" name="face" value="images/face/14.gif"><img src="images/face/16.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/13.gif"><img src="images/face/17.gif" width="32" height="32">
<input type="radio" name="face" value="images/face/14.gif"><img src="images/face/18.gif" width="32" height="32">
</td>
</tr>
<tr class="td">
<td align=center height=30><input type="submit" name="Submit" value="添 加"> <input type="reset" name="Submit2" value="重 置"> <input type="button" name="Submit3" value="取 消" onClick="javascript:history.back(-1);"></td>
</tr>
</table>
</td>
</tr>
<script>
function admin_size(num,objname)
{
var obj=document.getElementById(objname)
if (parseInt(obj.rows)+num>=3) {
obj.rows = parseInt(obj.rows) + num;
}
if (num>0)
{
obj.width="90%";
}
}
</script>
<tr class="td">
<td> 你的主页:</td>
<td><input name="homeurl" type="text" id="homeurl" size="20"></td>
</tr>
<tr class="td">
<td> 你的OICQ:</td>
<td><input name="qq" type="text" id="qq" size="20"></td>
</tr>
<tr class="td">
<td> 你的邮箱:</td>
<td><input name="email" type="text" id="email" size="20"></td>
</tr>
<tr class="td">
<td> 留言主题:</td>
<td><input name="title" type="text" id="title" size="20"></td>
</tr>
<tr class="td">
<td> 留言内容:<br><br>
<a href="javascript:admin_size(-2,'content')"><img src=images/minus.gif border=0 alt='缩小文本框长度'></a> <a href="javascript:admin_size(2,'content')"><img src=images/plus.gif border=0 alt='增加文本框长度'></a></td>
<td><textarea name="content" id="content" rows=4 cols=40></textarea></td>
</tr>
</table>
</tbody>
</form>
<%
username=request.form("username")
homeurl=request.form("homeurl")
qq=request.form("qq")
email=request.form("email")
title=request.form("title")
content=request.form("content")
face=request.form("face")
sql = "select * from user"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open sql,conn,3,2
Rs.addnew
Rs("username")=username
Rs("homeurl")=homeurl
Rs("qq")=qq
Rs("email")=email
Rs("title")=title
Rs("content")=content
Rs("face")=face
Rs("addtime")=now
Rs.update
Rs.close
set Rs = nothing
%>
</td>
</tr>
</table>
<br>