addnews.asp
来自「国内第一数字点卡销售程序。功能强大。 完整无错!数据文件经MD5加密!经严格测」· ASP 代码 · 共 81 行
ASP
81 行
<!--#include file="conn.asp"-->
<%
if session("admin_rank")<>1 and session("admin_rank")<>5 then
response.write("<script>alert('您无权查看本页,SORRY!');window.location=('login.asp')</script>")
response.end
end if
%>
<head>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<%
set rs=server.createobject("adodb.recordset")
if request("action")="save" then
news_title=trim(request("news_title"))
news_content=request("news_content")
if news_title="" or news_content="" then
response.write "<script language=javascript>alert('输入数据不能为空,谢谢合作!');history.go(-1);</script>"
response.End
else
news_title=server.htmlencode(news_title)
news_content=server.htmlencode(news_content)
news_content=replace(news_content," "," ")
news_content=replace(news_content,chr(13)&chr(10),"<br>")
sql="select * from news"
rs.open sql,conn,3,3
rs.addnew
rs("news_title")=news_title
rs("news_content")=news_content
rs("news_date")=date()
rs.update
rs.close
%>
<script language=vbs>
<!--
msgbox"新闻添加成功!"
window.location.href="delnews.asp"
-->
</script>
<%
end if
else%>
<body style="background-color: #F0FBF1">
<div align="center">
<table border="0" width="780" cellspacing="1">
<tr>
<td width="100%">
<form method="POST" action="addnews.asp?action=save">
<div align="center">
<table border="1" width="100%" cellspacing="0" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" cellpadding="0" bordercolor="#FFFFFF">
<tr>
<td width="100%" style="padding-left: 10px" height="31">添加商城动态:</td>
</tr>
<tr>
<td width="100%" style="padding-left: 10px" height="36">商城动态标题:<input type="text" name="news_title" size="20" class=input></td>
</tr>
<tr>
<td width="100%" style="padding-left: 10px" height="33">商城动态内容:</td>
</tr>
<tr>
<td width="100%" style="padding-left: 10px"><textarea rows="14" name="news_content" cols="79" class=input></textarea></td>
</tr>
</table>
</div>
<p> <input type="submit" value="提交" name="B1" class=input>
<input type="reset" value="重写" name="B2" class=input></p>
</form>
<p> </td>
</tr>
</table>
</div>
<%end if
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?