?? adminsave1.asp
字號(hào):
<%Admin="UserSee"%>
<!--#include file="check.asp"-->
<!--#include file="mdb_path_down.asp"-->
<%
dim id
dim newsname
dim newsnote
dim sql
dim rs
dim founderr
founerr=false
'if trim(request.form("newsname"))="" then
' founderr=true
' errmsg="<li>新聞名稱(chēng)不能空</li>"
'end if
if trim(request.form("newsnote"))="" then
founderr=true
errmsg=errmsg+"<li>公告內(nèi)容不能為空</li>"
end if
if founderr=false then
' newsname=request("newsname")
newsnote=request("newsnote")
set rs=server.createobject("adodb.recordset")
if request("action")="add" then
call newsoft()
elseif request("action")="edit" then
call editsoft()
end if
sub newsoft()
sql="select * from news where (id is null)"
rs.open sql,conn,1,3
rs.addnew
'rs("newsname")=newsname
rs("newsnote")=newsnote
rs("addtime")=date()
rs.update
end sub
sub editsoft()
sql="select * from news where id="&request("id")
rs.open sql,conn,1,3
'rs("newsname")=newsname
rs("newsnote")=newsnote
'rs("lasthits")=date()
rs.update
end sub
if makejs=1 then
UpdateJs(news)
end if
set rs=nothing
conn.close
set conn=nothing
%>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body bgcolor="#468ea3">
<br><br>
<table width="50%" border="0" cellpadding="3" cellspacing="1" align="center">
<tr>
<td width="100%" height="20" bgcolor="#145f74">
<p align="center"><font color="#FFFFFF">
<%if request("action")=add then%>
添加
<%else%>
修改
<%end if%>
公告成功</font>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#a5d0dc">
<p align="left"><br>
公告內(nèi)容為:<%=newsnote%></p>
您可以進(jìn)行其他操作
</td>
</tr>
</table>
<%
else
response.write "由于以下的原因不能保存數(shù)據(jù):"
response.write errmsg
end if
%>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -