好奇怪为什么这代码会在数据库里面生成两行数据
<!--#Include File="Connection.Asp"--><!--#Include File="Function.Asp"-->
<!--#Include File="JaClog.Asp"-->
<%
If Request.QueryString("action")="do" Then
pic_name = JaKillStr(Trim(Request.Form("Na")))
piccat_id = JaKillStr(Trim(Request.Form("ty")))
pic_pic = JaKillStr(Trim(Request.Form("pic")))
content1 = JaKillStr(Trim(Request.Form("content1")))
if content1="没有介绍" then
end if
if pic_name="" then
Response.Write "<script language=javascript>alert('请填写图片标题!');"
Response.Write "window.document.location.href='addpic.Asp';</script>"
Response.End()
end if
if piccat_id=0 then
Response.Write "<script language=javascript>alert('请选择相册分类!');"
Response.Write "window.document.location.href='addpic.Asp';</script>"
Response.End()
end if
if pic_pic="" then
Response.Write "<script language=javascript>alert('没有上传图片!');"
Response.Write "window.document.location.href='addpic.Asp';</script>"
Response.End()
end if
set rs2=server.createobject("adodb.recordset")
sql2="select * from pic where piccat_id="&piccat_id
rs2.open sql2,conn,1,1
s=rs2.recordcount
s=s+1
set rs=server.createobject("adodb.recordset")
sql="select * from pic where isbest=1 "
rs.open sql,conn,1,3
SqlA = "INSERT INTO [pic](pic_name,piccat_id,pic_pic,content1,isbest,guestname,xlid)VALUES('"&pic_name&"','"&piccat_id&"','"&pic_pic&"','"&content1&"',0,'"&SESSION("JaAdmin")&"','"&s&"')"
Conn.ExeCute(SqlA)
Response.Write "<script language=javascript>alert('添加相片成功!');"
Response.Write "window.document.location.href='photolist2.Asp';</script>"
Response.End()
End If
%>
<HTML><HEAD><TITLE>无标题文档</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="JaImg/css.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
</HEAD>
<BODY>
<form name="myform" method="post" action="?action=do">
<TABLE class=itemhead height=25 cellSpacing=0 cellPadding=0 width="100%"
align=center border=0>
<TBODY>
<TR>
<TD class=itemheadtd vAlign=bottom bgColor=#bcdbfe><table width="646" height="18" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="92" class="item"><a href="PhotoList.Asp"></a></td>
<td width="133" class="item"><a href="addPhotoList.Asp"></a></td>
<td width="129" class="item"><a href="addpic.Asp">添加相册图片</a></td>
<td width="292" class="item"><a href="PhotoList2.Asp">管理相册图片</a></td>
</tr>
</table></TD>
</TR></TBODY></TABLE>
<TABLE height=8 cellSpacing=0 cellPadding=0 width=100 border=0>
<TBODY>
<TR>
<TD></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=1 cellPadding=3 width="100%" align=center bgColor=#164481
border=0>
<TBODY>
<TR>
<TD align=middle width="13%" bgColor=#daebfe height=25><STRONG>图 片 名 称:</STRONG></TD>
<TD width="87%" bgColor=#E7EBF1> <INPUT
name=Na id="Na" size=35> </TD>
</TR>
<TR>
<TD align=middle bgColor=#daebfe height=25><STRONG>图 片 分 类:</STRONG></TD>
<TD bgColor=#E7EBF1><%
set rs2=server.createobject("adodb.recordset")
classname=SESSION("JaAdmin")
rs2.source="select * from piccat where piccat_classname=1 order by piccat_id desc"
rs2.open rs2.source,conn,1,1
%>
<select name=ty id="ty" onChange=go(this)>
<option value=0>请选择图片分类</option>
<%
for i=1 to rs2.RecordCount
qw=rs2("piccat_name")
%>
<option value=<%=rs2("piccat_id")%>><%=qw%></option>
<%
rs2.movenext
next
%>
</select> </TD>
</TR>
<TR>
<TD align=middle bgColor=#daebfe height=25><STRONG>图 片 上 传:</STRONG></TD>
<TD bgColor=#e7ebf1> <input name="pic" type="text" id="pic" size="35" readonly="true">
<iframe marginwidth=0 framespacing=0 marginheight=0 frameborder=0 width=100% height=25 scrolling=no src="PhotoUpload.asp"></iframe> </TD>
</TR>
<TR>
<TD align=middle bgColor=#daebfe height=25><STRONG>图 片 介 绍:</STRONG></TD>
<TD bgColor=#ffffff>
<textarea name="content1" style="display:none" cols="1" rows="1">
</textarea>
<iframe id="eWebEditor1" src="../../Editor1/ewebeditor.asp?id=content1&style=yy" frameborder="0" scrolling="no" width="100%" height="320" marginwidth="1" marginheight="1" name="wfasdg"></iframe> </TD>
</TR>
<TR>
<TD align=middle bgColor=#daebfe height=35> </TD>
<TD bgColor=#ffffff colSpan=2><INPUT class=button1 type=submit value=确认无误,我要添加 name=Submit23></TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</BODY></HTML>