admin_modi_info.asp
来自「购物系统时尚版.强大的后台文章编辑器的功能」· ASP 代码 · 共 132 行
ASP
132 行
<!--#include file="chk.asp"-->
<!--#include file="db_conn.asp"-->
<!--#include file="../my_lib/my_request.asp"-->
<%
flag=my_request("flag",1)
id=my_request("id",1)
action=my_request("action",0)
if action="save" then
call saveinfo()
else
sql="select * from info_list where id="&id
set rs=conn.execute (sql)
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="style.css" rel=stylesheet type=text/css>
<title>信息修改</title>
<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>
<!--#include file="TopManu.asp"-->
<div align="center">
<form action="admin_modi_info.asp" method="post" name="form1" onsubmit="return checkdata();">
<table border="0" width="100%" id="table1" cellspacing="0" style="border-collapse: collapse" cellpadding="0">
<tr>
<td background="image/admintoptdbg.gif">
<p align="left">
<img border="0" src="image/title_arrow.bmp" width="17" height="27" align="absmiddle"><font color="#808080"><b>信息更新</b></font></td>
</tr>
</table>
<table border="1" width="100%" id="table1" cellspacing="0" style="border:1px solid #CCCCCC; border-collapse: collapse; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" bordercolor="#EFEFEF" cellpadding="4" bgcolor="#F6F6F6">
<tr>
<td width="201" align="right">标题:</td>
<td width="549">
<input type="text" name="title" size="39" maxlength="50" value="<%=rs("title")%>"></td>
</tr>
<tr>
<td width="201" align="right">类别:</td>
<td width="549"><select size="1" name="leibie">
<option value="">请选择...</option>
<option value="1" <%if rs("flag")=1 then%> selected <%end if%>>网站动态</option>
<option value="2" <%if rs("flag")=2 then%> selected <%end if%>>网站公告</option>
</select></td>
</tr>
<tr>
<td width="201" align="right">内容:</td>
<td width="549">
<!--#include file="eokedit.asp"-->
<script language="javascript">
document.write ('<iframe src="news_textbox.asp?id=<%=id%>&action=modify" id="message" width="450" height="250"></iframe>')
frames.message.document.designMode = "On";
</script></td>
</tr>
<tr>
<td width="201" align="right">编辑:</td>
<td width="549">
<input type="text" name="editor" size="20" maxlength="20" value="<%=rs("editor")%>">
<input type="hidden" name="action" value="save">
<input type="hidden" name="id" value="<%=id%>">
<input type="hidden" name="flag" value="<%=flag%>"></td>
</tr>
<tr>
<td width="201">
</td>
<td width="546">
<font color="#FF0000">注意:添加公告时,请不要上传图片。</font></td>
</tr>
<tr>
<td colspan="2">
<p align="center"><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>
</table>
</form>
</div>
<table border="0" width="760" id="table3" cellspacing="0" cellpadding="0" align=center>
<tr>
<td align=right><input TYPE="button" VALUE="刷新本页" ONCLICK="location.reload()"> </td>
</tr>
</table>
</body>
</html>
<%
rs.close
set rs=nothing
end if
sub saveinfo()
title=my_request("title",0)
leibie=my_request("leibie",1)
content=my_request("content",0)
editor=my_request("editor",0)
if title="" or flag="" or content="" or editor="" then
response.write"<SCRIPT language=JavaScript>alert('信息未填写完整!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
else
'sql="insert into info_list (title,flag,content,editor,addtime) values('"&title&"',"&flag&",'"&content&"','"&editor&"','"&now()&"')"
sql="update info_list set title='"&title&"' ,flag="&leibie&",content='"&content&"',editor='"&editor&"' where id="&id
response.write sql
conn.execute(sql)
conn.close
set conn=nothing
select case flag
case 1
response.redirect "info_manage.asp?flag="&flag
case 2
response.redirect "info_manage.asp?flag="&flag
case else
response.redirect "admin_addinfo.asp"
end select
end if
end sub
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?