数据库没有设置为只读,every也分配了所有权限
代码如下
<%@LANGUAGE="VBScript" codepage="936"%>
<!--#include file="conn.asp"-->
<%
set rs=server.create
object("adodb.recordset")
sql="select user,qq,email,content,data from guestbook order by id desc"
rs.open sql,conn,1,1
%>
<%do while not rs.eof%>
<%
if Request("user")<>"" then
SQL="Select * from guestbook"
Set rs=Server.Create
Object("ADODB.RecordSet")
rs.Open SQL,con,3,3
rs.addnew
for each name1 in Request.Form
if name1<>"Submit" then
rs(name1)=request.Form(name1)
end if
next
rs.update
Set rs=nothing
Response.Write("<script>alert('记录添加成功')</script>")
end if
%>
<html>
<head>
<title>留言</title>
</head>
<table width="500" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="593" height="40" bgcolor="#FFFFFF" class="text03">游客昵称:<%=rs("user")%> <br>
留言时间: <%=rs("data")%><br>
留言内容: <%=rs("content")%><br>
游 客 QQ: <%=rs("qq")%><br>
邮 件:<%=rs("email")%>
</td>
<%
rs.movenext
loop
%>
</tr>
</table>
<table width="100%" border="0" cellspacing="4" cellpadding="0">
<tr>
<td width="13%" class="text02">游客昵称:</td>
<td width="87%"><input name="user" type="text" id="user" value="user" size="40"></td><br>
</tr>
<tr>
<td width="13%" class="text02"> QQ号:</td>
<td width="87%"><input name="qq" type="text" id="qq" value="qq" size="40"></td><br>
</tr>
<tr>
<td width="13%" class="text02">邮件:</td>
<td width="87%"><input name="email" type="text" id="email" value="email" size="40"></td><br>
</tr>
<tr>
<td width="13%" height="55" class="text02">留言:</td>
<td width="87%"><form name="form1" method="post" id="content" action="addsave.asp">
<textarea name="content"></textarea>
</form></td>
<br>
</tr>
</table>
<table width="420" border="0">
<tr>
<td width="410"><form name="form2" method="post" action="addsave.asp">
<div align="center">
<input type="submit" name="Submit" value="提交">
<input name="Submit2" type="reset" id="Submit2" value="重置">
</div>
</form></td>