?? adminsave.asp
字號(hào):
<!--#include file="connection.asp"-->
<!--#include file="char.asp"-->
<%
dim rs,sql
dim title
dim content
dim articleid
dim classid,Nclassid
dim Nkey
dim writer
dim writefrom
dim errmsg
dim founderr
founerr=false
if trim(request.form("txttitle"))="" then
founderr=true
errmsg="<li>文件標(biāo)題不能為空</li>"
end if
if trim(request.form("typeid"))="" then
founderr=true
errmsg="<li>文件類型不能為空</li>"
end if
if trim(request.form("txtcontent"))="" then
founderr=true
errmsg=errmsg+"<li>文件內(nèi)容不能為空</li>"
end if
if founderr=false then
title=htmlencode(request.form("txttitle"))
typeid=request.form("typeid")
if request("htmlable")="yes" then
content=htmlencode2(request("txtcontent"))
else
content=ubbcode(request.form("txtcontent"))
end if
set rs=server.createobject("adodb.recordset")
if request("action")="add" then
call newsoft()
elseif request("action")="edit" then
call editsoft()
else
founderr=true
errmsg=errmsg+"<li>沒有選定參數(shù)</li>"
end if
sub newsoft()
sql="select * from learn where (id is null)"
rs.open sql,conn,3,3
rs.addnew
rs("title")=title
rs("content")=content
rs("type")=typeid
rs("time")=date()
rs.update
articleid=rs("id")
end sub
sub editsoft()
sql="select * from learn where id="&request("id")
rs.open sql,conn,1,3
rs("title")=title
rs("content")=content
rs("type")=typeid
rs.update
articleid=rs("id")
end sub
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div align="center"><center>
<br><br>
<table width="50%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td width="100%" bgcolor="#999999" height="20"><p align="center"><font color="#FFFFFF"><b>
<%if request("action")="add" then%>添加<%else%>修改<%end if%>文件成功</b></font></td>
</tr>
<tr>
<td width="100%"><p align="left"><br>
文章標(biāo)題為:<%response.write title%></p>
<A HREF="freeadd.asp">繼續(xù)添加</A> <A HREF="javaScript:window.close()">關(guān)閉窗口</A>
</td>
</tr>
</table>
</center></div>
<%
else
response.write "由于以下的原因不能成功添加文件數(shù)據(jù):"
response.write errmsg
response.write "<BR><A HREF=javascript:history.back(1)>返回重填寫</A>"
end if
%>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -