📄 npost_modi.asp
字号:
<!-- #include file="inc/Session.asp" -->
<%dim dbpath,nownum
dbpath="../"
nownum=4
%>
<!--#include file="../nUser/config.asp"-->
<!--#include file="../nUser/conn.asp"-->
<!--#include file="inc/MyRequest.asp"-->
<%
id=my_request("id",1)
if id="" or isnull(id) or IsNumeric(id)=False then
response.write("<script>alert(""参数错误!"");location.href=""ZhuanTiList.asp"";</script>")
response.end
end if
sql="select * from kheu_nPost where id="&id
set rs=conn.execute (sql)
Title=rs("Title")
nType=rs("nType")
rs.close
set rs=nothing
flag=my_request("flag",0)
if flag="save" then
call ZhuanTiModiSave()
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>专题信息-修改</title>
<link href="Css.css" rel="stylesheet">
<script language = "JavaScript">
function checkdata()
{
if (document.form1.viewhtml.checked == true)
{
alert("对不起,请取消“查看HTML源代码”后再添加!")
document.form1.viewhtml.focus()
return false
}
}
</script>
<script src="edit.js" type="text/javascript"></script>
</head>
<body>
<table cellspacing="1" cellpadding="4" width="100%" class="tableborder">
<form name="form1" action="nPost_Modi.asp" method="post" onsubmit="return checkdata();">
<input type="hidden" name="id" value="<%=id%>">
<input type="hidden" name="flag" value="save">
<tr>
<td colspan="2" class="header">博客日志-修改<span style="font-weight: 400">
(<font color="red">*</font>为必填项,其他信息可选填,不填不显示)</span></td>
</tr>
<tr>
<td class="altbg1" width="15%" align="right"><font color="red">*</font>日志标题:</td>
<td class="altbg2" width="83%">
<input type="text" name="Title" size="60" value="<%=Title%>"></td>
</tr>
<tr>
<td class="altbg1" width="15%" align="right"><font color="red">*</font>日志类别:</td>
<td class="altbg2" width="83%">
<select name="nType" onChange="changelocation(document.form1.bid.options[document.form1.bid.selectedIndex].value)" size="1">
<option>请选择所属类别</option>
<%
sql="select * from kheu_nType order by id desc"
set rs=conn.execute (sql)
do while not rs.eof
%>
<option value="<%=rs("id")%>" <%if rs("id")=nType then response.write "selected" %>><%=rs("title")%></option>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</select> </td>
</tr>
<tr>
<td class="altbg1" width="15%" align="right"> <font color="red">*</font>信息内容:</td>
<td class="altbg2" width="83%">
<!--#include file="eokedit.asp"-->
<script language="javascript">
document.write ('<iframe src="nPost_Text.asp?id=<%=id%>&action=modify" id="message" width="95%" height="350"></iframe>')
frames.message.document.designMode = "On";
</script>
</td>
</tr>
<tr>
<td class="altbg1" width="15%" align="right"> </td>
<td class="altbg2" width="83%"><input type="submit" value="提交" name="B1" onclick="document.form1.Content.value = frames.message.document.body.innerHTML;"> <input type="reset" value="重置" name="B2"><input type="hidden" name="Content" value></td>
</tr>
</form>
</table>
<%
sub ZhuanTiModiSave()
id=my_request("id",1)
Title=my_request("Title",0)
nType=my_request("nType",1)
Content=my_request("Content",0)
if id="" or Title="" or nType="" or Content="" then
response.write"<SCRIPT language=JavaScript>alert('信息未填写完整!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
else
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from kheu_nPost where id="&id
rs.open sql,conn,1,3
rs("Title")=Title
rs("nType")=nType
rs("Content")=Content
rs("clicked")=clicked+1
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<p align=center><font color=red><span style='font-size: 12px'>一条专题信息修改成功,<br>2秒钟后返回专题管理页!</span></font>"
response.write "<meta http-equiv=""refresh"" content=""1;url=nPost.asp"">"
response.end
end if
end sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -