%
if session("administrator")="" then
response.redirect "default.asp"
end if
%>
<%
dim filename
dim showname
dim note
dim sql
dim rs
dim cansave
dim founderr
dim errmsg
dim face
dim hot
dim typename
founerr=false
if trim(request.form("txtfilename"))="" then
founderr=true
errmsg="
實際檔名不能沒填"
end if
if trim(request.form("txtshowname"))="" then
founderr=true
errmsg=errmsg+"顯示名稱不能沒填"
end if
if founderr=false then
filename=request.form("txtfilename")
showname=htmlencode2(request.form("txtshowname"))
note=htmlencode2(request.form("txtnote"))
typename=htmlencode2(request.form("typename"))
hot=htmlencode2(request.form("hot"))
face=htmlencode2(request.form("face"))
set rs=server.createobject("adodb.recordset")
sql="select * from download where id="&request("id")
rs.open sql,conn,1,3
rs("filename")=filename
rs("showname")=showname
rs("note")=note
rs("face")=face
rs("hot")=hot
rs("typename")=typename
rs("dateandtime")=date()
rs.update
rs.close
set rs=noting
conn.close
set conn=nothing
response.redirect "default.asp?page="&request("page")
else
response.write "由於以下的原因不能保存資料:"
response.write errmsg
end if
%>