📄 addnews.asp
字号:
<!--#include file="conn.asp"-->
<%if session("bjxadmin")="" then
response.Write "<script LANGUAGE='javascript'>alert('网络超时或者您还没有登录请登录');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>2 then
response.Write "<p align=center><font color=red>您没有此项目管理权限!</font></p>"
response.End
end if
end if
if request.QueryString("action")="save" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from BJX_news",conn,1,3
rs.addnew
rs("newsname")=trim(request("newsname"))
rs("addname")=trim(request("addname"))
Content=Request.Form("Content")
'将里面的链接换成本地链接
aa="http://"&Request.ServerVariables("server_name")&Request.ServerVariables("path_info")
aa= mid(aa,1,len(aa)-17) '16=admin/addnews.asp
'response.write aa
'response.end
content=replace(content,aa,"")
session("content")=content
rs("newscontent")=content
rs("adddate")=now()
rs("viewcount")=0
rs.update
rs.close
set rs=nothing
session("content")=""
response.write "<script language=javascript>alert('添加成功!');window.location.href='editnews.asp';</script>"
response.End
end if
%>
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
<!--
function checkdata()
{
if (document.form1.newsname.value=="")
{
alert("对不起,请输入新闻主题!")
document.form1.newsname.focus()
return false
}
if (document.form1.viewhtml.checked == true)
{
alert("对不起,请取消“查看HTML源代码”后再添加!")
document.form1.viewhtml.focus()
return false
}
if (document.form1.Content.value.length==0)
{
alert("对不起,请输入文章内容!")
//document.form1.content.focus()
return false
}
}
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<link href="../images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>
<body>
<table class="tableBorder" width="90%" border="0" align="center" cellpadding="0" cellspacing="1" >
<tr>
<td align="center" background="../images/admin_bg_1.gif" height="25"><span class="style1">添加网站新闻</span></td>
</tr>
<tr>
<td valign="top">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1">
<form name="form1" method="post" action="addnews.asp?action=save" onSubmit="return checkdata()" onReset="return ResetForm();">
<tr >
<td width="20%" align="right">新闻主题:</td>
<td style="PADDING-LEFT: 10px">
<input name="newsname" type="text" id="newsname" size="30"></td>
</tr>
<tr >
<td align="right">发 表 人:</td>
<td style="PADDING-LEFT: 10px">
<input name="addname" type="text" id="addname" size="30">
</td>
</tr>
<tr >
<td align="right" valign="top">新闻内容:</td>
<td style="PADDING-LEFT: 10px">
<%
dim bjxc,bjxi
bjxc = ""
bjxi = "Content"
%><input type="hidden" id="myEditor" value="" style="display:none" /><textarea id="Content" name="Content" style="display:none"><div><%= bjxc %></div></textarea><iframe id="Content___Frame" src="Iheeo_editor/editor.htm?id=Content&ReadCookie=0" frameborder="0" scrolling="no" width="621" height="457"></iframe>
</td>
</tr>
<tr >
<td height="30"></td>
<td height="30" style="PADDING-LEFT: 10px">
<input type="submit" name="Submit" value="提交发表" >
<input onclick="ClearReset()" type=reset name="Clear" value="重新填写">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -