📄 editnews4.asp
字号:
<%@ Language=VBScript %>
<% If Session(strCookieURL & "www.3rom.com") = "1369852475213" and Session("count")<10 Then %>
<!--#INCLUDE FILE="inc_Conn.asp" -->
<%
Dim strTitle,strSql
strTitle=Session("Title")
If strTitle="" Then
Response.redirect "index.asp"
Else
strSql="select top 1 * from News where News_Title="
strSql=strSql & "'" & strTitle & "'"
strSql=StrSql & " order by NewsID Desc"
set rs=MyCon.execute(strSql)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>EditNews4</title>
</head>
<body bgcolor="#D6D3CE">
<%If Request.querystring("active")="upload" Then
Call MyUpload()
Else
Call MyList()
End If
%>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="755">
<tr>
<td width="100%" align="center"><a href="index.asp">返回管理</a></td>
</tr>
</table>
</center>
</div>
</body>
</html>
<%
rs.close
set rs=nothing
MyCon.close
set MyCon=nothing
End If
%>
<% Sub MyList() %>
<div align="center">
<center>
<form method="POST" action="EditNews4.asp?active=upload" enctype="multipart/form-data" name="upform">
<%
Dim strImage
strImage=rs("News_Image")
%>
<table border="1" width="75%" cellspacing="0" cellpadding="0">
<% Do while not rs.eof %>
<tr>
<td width="50%">新闻:<a href="../ReadNews.asp?NewsID=<%=rs("NewsID")%>"><%=rs("News_Title")%></a>修改成功
</td>
<td width="50%"><% If strImage>0 Then %>本新闻需要<%=strImage%>张图片 <% Else %>本新闻不需要图片<% End If %></td>
</tr>
<%
If strImage>0 Then
for i=1 to strImage
%>
<tr>
<td width="100%" align="center" colspan="2" valign="middle" nowrap>
上传图片<%=i%><input type="file" name="file<%=i%>" size="20"></td>
</tr>
<% Next %>
<tr>
<td width="100%" align="center" colspan="2"><input type="submit" value=" 上传 " name="Up">
<input type="reset" value=" 重置 " name="Reset"></td>
</tr>
<% End If %>
<% rs.movenext %>
<% Loop %>
</table>
</form>
</center>
</div>
<% End Sub %>
<% Sub MyUpload() %>
<!--#INCLUDE FILE="inc_upload_3rom.asp" -->
<%
dim upload,file,formName,formPath,iCount,strFileName
set upload=new upload_3Rom ''建立上传对象
formPath="../tools/Images/"
iCount=0
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
strFileName=rs("NewsID")&"_"&iCount+1
strFileName=strFileName&"." & "jpg"
file.SaveAs Server.mappath(formPath&strFileName) ''保存文件
iCount=iCount+1
%>
<div align="center">
<center>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" bgcolor="#C0C0C0">上传文件信息</td>
</tr>
<tr>
<td width="100%" valign="top" align="center"><%=file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&strFileName&" 上传成功!<br>"
%></td>
</tr>
<tr>
<td width="100%" align="center"><a href="index.asp">返回管理</a></td>
</tr>
</table>
</center>
</div>
<meta http-equiv="Refresh" content="2; URL=index.asp">
<%
end if
set file=nothing
next
set upload=nothing ''删除此对象
%>
<% End Sub %>
<%
Else
Response.redirect "Login.asp"
End If
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -