日期:2014-05-16  浏览次数:20852 次

循环语句中,文本栏究竟怎么定义循环名?
index.asp
<%
response.expires=0
response.cachecontrol="no-cache"
%>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("tongbao.mdb")
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from xj Order By hound DESC ",conn,3,2
%>
  <table width="1141" align="center" cellpadding="1" cellspacing="1">
  <%
do while not rs.eof
%>
<tr bordercolor="#000000" bgcolor="#FFFFFF" class="STYLE1"  cellspacing="1" cellpadding="1">
<td><%=rs("id")%></td>
<td width="427"  bgcolor='#006699'><p align="center" class="STYLE5"><font size="2">
添加图片</font> </p>
<iframe src="2_upload.asp" width="298" height="40" frameborder=0 scrolling=no> </iframe>
<input name="image" type="text" size="15"></td>/*循环时我这里的image应
该怎么定义命名?*/

  </tr>
  <%
rs.movenext
loop
%>
</table>
</center>
<%rs.close
conn.close%>
2_upload.asp
<HTML>
<BODY BGCOLOR="#666666">
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="3_upload_update.asp"> 
<INPUT TYPE="FILE" SIZE="20" NAME="FILE1"> <INPUT TYPE=SUBMIT VALUE="保存">
</FORM>
</BODY>
</HTML>

3_upload_update.asp
<%OPTION EXPLICIT%>
<%Server.ScriptTimeOut=5000%>
<!--#include FILE="upload_5xsoft.inc"-->
<body>
<%
dim upload,file,formName,formPath,iCount,filesize
set upload=new upload_5xsoft ''建立上传对象
formpath="../shujuku/images/"
for each formName in upload.objFile ''列出所有上传了的文件
 set file=upload.file(formName)  ''生成一个文件对象
 if file.filesize<100000000 then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">请先选择你要上传的文
件! [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if
if file.fileext<>"jpg" and file.fileext<>"bmp" then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">只
能上传jpg或bmp格式的图片! [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if
if file.filesize>(90000000*90000000) then
response.write "<span style=""font-family: 宋体; font-size: 9pt"">上传图片文件过大!!! [ <a href=# onclick=history.go(-1)>重新上传</a> ]</span>"
response.end
end if 
next
    file.FileName=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)'重命名
     file.fileext=".bmp"
  file.SaveAs Server.mappath(formPath&file.FileName&file.Fileext)   ''保存文件
  response.write ("<a href='del_pic_wai_upload_update.asp?pic="&File.FileName&file.filEext&"'>删除图片</a>")
  response.write "<script language=javascript>parent.document.image.value='../images/"&File.Fil