?? down_save.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="../Inc/Config.asp"-->
<!--#include file="../Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
ID=Request.Form("ID")
Title=Trim(request.form("Title"))
BigClassName=trim(request.form("BigClassName"))
SmallClassName=trim(request.form("SmallClassName"))
Content=trim(request.form("Content"))
System=trim(request.form("System"))
Softclass=trim(request.form("Softclass"))
PhotoUrl=trim(request.form("PhotoUrl"))
DownloadUrl=trim(request.form("DownloadUrl"))
FileSize=trim(request.form("FileSize"))
Infotime=trim(request.form("Infotime"))
Action=trim(request("Action"))
if BigClassName="" then
founderr=true
errmsg=errmsg+"<li>未指定下載所屬大類</li>"
end if
if Content="" then
founderr=true
errmsg=errmsg+"<li>下載說明不能為空</li>"
end if
if Softclass="" then
founderr=true
errmsg="<li>軟件類型不能為空</li>"
end if
if FileSize="" then
founderr=true
errmsg="<li>文件大小不能為空</li>"
end if
if founderr=false then
Title=dvhtmlencode(Title)
if Infotime<>"" and IsDate(Infotime)=true then
Infotime=CDate(Infotime)
else
Infotime=now()
end if
set rs=server.createobject("adodb.recordset")
select case Action
case "Add"
sql="select * from Download where (id is null)"
rs.open sql,conn,1,3
rs.addnew
call SaveData()
rs.update
rs.close
set rs=nothing
response.redirect "Down_Manage.asp"
case "Modify"
if ID<>"" then
sql="select * from Download where id="&ID
rs.open sql,conn,1,3
if not (rs.bof and rs.eof) then
call SaveData()
rs.update
rs.close
set rs=nothing
response.redirect "Down_Manage.asp"
else
founderr=true
errmsg=errmsg+"<li>找不到此下載,可能已經被刪除。</li>"
call WriteErrMsg()
end if
else
founderr=true
errmsg=errmsg+"<li>不能確定下載ID的值</li>"
call WriteErrMsg()
end if
Case else
founderr=true
errmsg=errmsg+"<li>沒有選定參數</li>"
call WriteErrMsg()
end select
call CloseConn()
else
WriteErrMsg
end if
%>
<%
sub SaveData()
rs("Title")=Title
rs("Content")=Content
rs("BigClassName")=BigClassName
rs("SmallClassName")=SmallClassName
rs("System")=System
rs("Softclass")=Softclass
rs("PhotoUrl")=PhotoUrl
rs("DownloadUrl")=DownloadUrl
rs("FileSize")=FileSize
rs("Infotime")=Infotime
end sub
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -