⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 npost_add.asp

📁 shopxp网上购物系统v6.6已经调试,百分百可用
💻 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"-->
<%
flag=my_request("flag",0)
if flag="save" then
   call ZhuanTiAddsave()
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" id="table3">
<form action="nPost_Add.asp" method="post" name="form1" onsubmit="return checkdata();">
<input type="hidden" name="flag" value="save">
	<tr>
		<td colspan="2" class="header">博客日志-添加</td>
	</tr>
	<tr>
		<td class="altbg1" width="14%">日志标题:</td>
		<td class="altbg2" width="83%">
			<input type="text" name="title" size="60" maxlength="50"></td>
	</tr>
	<tr>
		<td class="altbg1" width="14%">日志类别:</td>
		<td class="altbg2" width="83%">
		  <select size="1" name="nType">
		  <option>请选择所属类别</option>
		  <%
		   sql="select id,title from kheu_nType order by id"
		   set rs=conn.execute (sql)
		   do while not rs.eof
		  %>
		  <option value="<%=cint(rs("id"))%>"><%=rs("title")%></option>
		  <%
		   rs.movenext
		   loop
		   rs.close
		   set rs=nothing
		  %>	
		</select>
	  </td>
	</tr>
	<tr>
		<td class="altbg1" width="14%">信息内容:</td>
		<td class="altbg2" width="83%">
		 <!--#include file="eokedit.asp"-->
         <script language="javascript">
          document.write ('<iframe src="nPost_Text.asp" id="message" width="95%" height="350"></iframe>')
          frames.message.document.designMode = "On";
         </script>
        </td>
	</tr>
	<tr>
		<td class="altbg1" width="14%"> </td>
		<td class="altbg2" width="83%"><input type="submit" value="提交" name="B1" onclick="document.form1.Content.value = frames.message.document.body.innerHTML;">&nbsp; <input type="reset" value="重置" name="B2"><input type="hidden" name="Content" value></td>
	</tr>
</form>
</table>
<%
sub ZhuanTiAddSave() 
  Title=my_request("Title",0)
  nType=my_request("nType",0)
  Content=my_request("Content",0)
  if 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 Title='"&Title&"'"
    rs.open sql,conn,1,3
    if not(rs.eof and rs.bof) then
      response.write"<SCRIPT language=JavaScript>alert('词条标题重复,返回重填!');"
      response.write"javascript:history.go(-1)</SCRIPT>"
      response.end
    else    
      rs.addnew
      rs("Title")=Title
      rs("nType")=nType
      rs("Content")=Content
      rs("nUser")=UserID
      rs("date")=now()
      rs("show_flag")=false
      rs("first_flag")=false
      rs("clicked")=0
      rs("build_flag")=false     
      rs.update
    end if
    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 + -