这个文件本来分为2个
修改和保存数据,想把这2个文件和并,
刚上手ASP请多多指教
<!--#include file="conn.asp"-->
<%
IF (Request.QueryString("flag")="ReplySave") Then
hnm=request("hnm")
hnr=request("hnr")
if hnm="" then hnm="管理员"
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from gbook where id="& Request("id")
rs.open sql,conn,1,3
rs("hnm") =hnm
rs("hnr") =hnr
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "admingbook.asp"
end if
%>
<%
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from gbook where id="&request("id")
rs.open sql,conn,1,3
%>
<form action="hfadd.asp" method="post" name="form1">
姓名<input name="hnm" type="text" value="<%=rs("hnm")%>"><br>
内容<textarea name="hnr" cols="70" rows="12" value="<%=rs("hnr")%>">
<%=rs("hnr")%>
</textarea><br>
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
<input type="hidden" name="id" value="<%=rs("id")%>">
<input name="Flag" type="hidden" value="ReplySave">
</form>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>