?? adrot_save.asp
字號:
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include FILE="../../inc/upload_5xsoft.inc"-->
<%
if Request.Cookies("globalec")("globalecmaster")="" or Request.Cookies("globalec")("masterflag")="" then
response.write "<script language='javascript'>"
response.write"this.location.href='../login.asp';</SCRIPT>"
response.end
end if
if instr(Request.Cookies("globalec")("masterflag"),"24")=0 then
response.redirect "../err.asp"
response.end
end if
set upload=new upload_5xSoft
formPath="/company/"
formPath2="modpic/"
typename1=Replace_Text(upload.form("typename"))
alt=Replace_Text(upload.form("content"))
type1=Replace_Text(upload.form("type1"))
'iCount=0
for each formName in upload.objFile
set file=upload.file(formName)
if file.FileSize>0 then
if file.filesize>200000 then
response.write"<SCRIPT language=JavaScript>alert('您上傳的圖片大于規(guī)定大小(200K),請改變文件大小后再進行上傳。');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
FileExt = Mid(file.Filename, InStrRev(file.Filename, ".")+1)
FileExt = FixName(FileExt)
If Not ( CheckFileExt(FileExt) and CheckFileType(File.FileType) ) Then
'if trim(right(file.FileName,3))<>"jpg" and trim(right(file.FileName,3))<>"gif" then
response.write"<SCRIPT language=JavaScript>alert('您上傳的文件必須是gif|jpg|jpeg|bmp|png圖象文件,請將你上傳的文件轉換為以上格式后再進行上傳。');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
'FileName=gsid&MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)
FileName=formPath2&MakedownName()&"."&FileExt
Dim objFSO '聲明一個名稱為 objFSO 的變量以存放對象實例
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(Server.MapPath(""&formPath&""&formPath2&"")) Then'如果存在就直接保存圖片
file.SaveAs Server.mappath(formPath&thename)
Else
objFSO.CreateFolder(Server.MapPath(""&formPath&""&formPath2&""))'不存在就建一個目錄
file.SaveAs Server.mappath(formPath&thename)
End If
Set objFSO = Nothing '釋放 FileSystemObject 對象實例內存空間
file.SaveAs Server.mappath(formPath&FileName)
picture=FileName
'iCount=iCount+1
end if
next
set file=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from mod where type1='"&type1&"' and typename='"&typename1&"'"
rs.open sql,conn,1,3
if not rs.eof then
response.write"<SCRIPT language=JavaScript>alert('對不起,您已經(jīng)提交過此信息!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
else
rs.addnew
rs("typename") =typename1
rs("alt") =alt
rs("src") =picture
rs("type1")=type1
rs.update
rs.close
set rs=noting
conn.close
set conn=nothing
set upload=nothing
end if
%>
<link rel="stylesheet" type="text/css" href="../css/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加模版</title>
<body bgcolor="#FFFFFF" marginheight=0 marginwidth=0 leftmargin=0>
<table cellpadding=2 cellspacing=1 border=0 width=400 class=tableBorder align=center><TR>
<TH class=tableHeaderText colSpan=2 height=25>添加自助建站模版</TH>
<TR><tr><td height=85 valign=top class=forumRow><div align=center><br><br>
添加模版成功!</div></td></tr><tr align=center><td height=30 class=forumRowHighlight><a href='index.asp'><< 返回上一頁</a></td>
</tr></table>
<br>
<!--#include file="../copy.asp" -->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -