📄 anews_ok.asp
字号:
<!--#include file="conn.asp"-->
<%
action=request("action")
if action="add" then '添加数据
if request("name")="" then
Response.Write("<script>alert('标题不能为空,请填写!');history.back(-1);</script>")
response.end
end if
if request("content")="" then
Response.Write("<script>alert('内容不能为空,请填写!');history.back(-1);</script>")
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from news",conn,3,2
rs.addnew
rs("name")=request("name")
rs("type")=request("type")
rs("content")=request("content")
rs.update
Response.Write("<script>alert('添加成功!');window.location='anews_add.asp';</script>")
elseif action="mdf" then '修改数据
set rs=server.createobject("adodb.recordset")
rs.open"select * from news where id=" &request("id"),conn,1,3
rs("name")=request("name")
rs("type")=request("type")
rs("content")=request("content")
rs.update
Response.Write("<script>alert('修改成功!');window.location='anews_list.asp';</script>")
elseif action="del" then '删除数据
sql="delete from news where id=" &request("id")
set rs=conn.execute(sql)
Response.Write("<script>alert('删除成功!');window.location='anews_list.asp';</script>")
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -