📄 admin_affiche_modify.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%Option Explicit%>
<%
if request.cookies("admin_OK")="" then
response.redirect("admin_login.html")
end if
%>
<%
dim db
db=0
%>
<!-- 后台公告管理->修改公告 -->
<!-- #include file="../config/db.asp" -->
<!-- #include file="../config/function.inc.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>公告管理--修改公告</title>
</head>
<body>
<%
dim sql,rst,myErrors
'case:更新数据
if request.querystring("act")="update" then
if isnumeric(request.querystring("id")) and not isempty(request.querystring("id")) then
set rst=server.createobject("adodb.recordset")
sql="select * from shop_affiche where a_id="&request.querystring("id")
rst.open sql,conn,1,3
if rst.eof then
msgboxU("错误的参数或记录已经不存在")
else
rst("a_title")=request.form("f_title")
rst("a_content")=request.form("f_content")
rst.update
end if
set myErrors=conn.errors
if myErrors.count=0 then
msgboxU("更新成功!")
'----------返回公告管理页面---------
response.Redirect("admin_affiche.asp")
else
msgboxU("更新失败!原因:"&myErrors.item(0).description)
end if
rst.close
set rst=nothing
else
msgboxU("参数错误")
end if
end if
'case:显示数据
if request.querystring("act")="modify" then
if isnumeric(request.querystring("id")) and not isempty(request.querystring("id")) then
set rst=server.createobject("adodb.recordset")
sql="select * from shop_affiche where a_id="&request.querystring("id")
rst.open sql,conn,1,1
%>
<form id="form" name="form" method="post" action="admin_affiche_modify.asp?act=update&id=<%=request.querystring("id")%>">
<table width="827" height="356" border="1" cellpadding="0" cellspacing="0">
<tr>
<td height="42" colspan="2">公告管理--修改公告</td>
</tr>
<tr>
<td width="78" height="36">公告标题:</td>
<td width="658"><input name="f_title" type="text" id="f_title" value="<%=rst("a_title")%>" size="80" maxlength="127" /></td>
</tr>
<tr>
<td height="237">公告内容:</td>
<td><textarea name="f_content" cols="90" rows="25" id="f_content"><%=rst("a_content")%></textarea></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="提交公告" />
<input type="submit" name="Submit2" value="提交" />
</div></td>
</tr>
</table>
</form>
<%
rst.close
set rst=nothing
else
msgboxU("参数错误")
end if
end if
conn.close
set conn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -