asp图片只能上传一张,标题和内容上传没问题,请高手帮我看看代码怎么改???
<!--#includefile="../../conn/conn.asp"--><!--#includeFILE="../ntkish.inc"--><!--无组件上传...
<!--#include file="../../conn/conn.asp"-->
<!--#include FILE="../ntkish.inc"--> <!--无组件上传文件-->
<%
set rs=server.createobject("adodb.recordset")
sql="select * from about_about_2 "
rs.open sql,conn,1,3
%>
<form name="form1" method="post" action="" enctype="multipart/form-data"><p>
图片:<input type=file name="PIC1"></p><p>
图片:<input type=file name="PIC2"></p><p>
标题:<input name="BT1" type="text" id="BT1"></p><p>
标题:<input name="BT2" type="text" id="BT2"></p><p>
内容:<textarea name="NR1" cols="" rows="" id="NR1"></textarea></p><p>
内容:<textarea name="NR2" cols="" rows="" id="NR2"></textarea></p><p>
<input type=submit name="submit" value=" 提 交 "></p>
</form>
<%
set upload=new upload_5xsoft
set file=upload.file("PIC1")
kzm=right(file.filename,4)
name="../../Images/About/UP/" & year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&kzm
if file.fileSize>0 Then
If kzm<>".gif" And kzm<>".jpg" Then
else
file.SaveAs Server.mappath(name)
rs.addnew
rs("PIC1")=name
rs("PIC2")=name
rs("BT1")=upload.Form("BT1")
rs("BT2")=upload.Form("BT2")
rs("NR1")=upload.Form("NR1")
rs("NR2")=upload.Form("NR2")
%>
<%
Response.Write("<script language='JavaScript'>alert('添加成功!');</script>")
rs.update
rs.close
set rs=nothing
conn.close
set rs=Nothing
conn.close
End If
End If
set file=nothing
set upload=Nothing
%> 展开
<!--#include FILE="../ntkish.inc"--> <!--无组件上传文件-->
<%
set rs=server.createobject("adodb.recordset")
sql="select * from about_about_2 "
rs.open sql,conn,1,3
%>
<form name="form1" method="post" action="" enctype="multipart/form-data"><p>
图片:<input type=file name="PIC1"></p><p>
图片:<input type=file name="PIC2"></p><p>
标题:<input name="BT1" type="text" id="BT1"></p><p>
标题:<input name="BT2" type="text" id="BT2"></p><p>
内容:<textarea name="NR1" cols="" rows="" id="NR1"></textarea></p><p>
内容:<textarea name="NR2" cols="" rows="" id="NR2"></textarea></p><p>
<input type=submit name="submit" value=" 提 交 "></p>
</form>
<%
set upload=new upload_5xsoft
set file=upload.file("PIC1")
kzm=right(file.filename,4)
name="../../Images/About/UP/" & year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&kzm
if file.fileSize>0 Then
If kzm<>".gif" And kzm<>".jpg" Then
else
file.SaveAs Server.mappath(name)
rs.addnew
rs("PIC1")=name
rs("PIC2")=name
rs("BT1")=upload.Form("BT1")
rs("BT2")=upload.Form("BT2")
rs("NR1")=upload.Form("NR1")
rs("NR2")=upload.Form("NR2")
%>
<%
Response.Write("<script language='JavaScript'>alert('添加成功!');</script>")
rs.update
rs.close
set rs=nothing
conn.close
set rs=Nothing
conn.close
End If
End If
set file=nothing
set upload=Nothing
%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询