www.gusucode.com > 枫的记忆个人主页程序源码程序 > downcode.com\fengdejiyizh\admin\add_news.asp

    <link href="admin.css" rel="stylesheet" type="text/css">
<%
	if session("level")<>"1" then
		Response.Write("你无权访问此页面!")
		Response.End
	end if	
%>
<!--#INCLUDE FILE="conn.asp"-->
<%
  hidden=trim(request("hidden"))
 
  if hidden="ok" then
  n_type=trim(request("n_type"))
  title=request("title")
  n_from=trim(request("n_from"))
  add_time=trim(request("add_time"))
  content=request("content")
  
  set rs=server.createobject("adodb.recordset")
  sql="select * from news"
  rs.Open sql,conn,1,3
  rs.addnew
  rs("n_type")=n_type
  rs("title")=title
  rs("n_from")=n_from
  rs("content")=content
  rs("add_time")=date()
  rs.update
	if err.number<>0 then
	    Response.Write("<script language=javascript>alert('添加失败,请点击返回');history.back();</script>")
	    Response.End
	else
		Response.Redirect "manage_news.asp"
		Response.End
	end if
  end if
%>

<body bgcolor="#CDD5DE">
<table width="85%" border="0" cellspacing="1" cellpadding="0" align="center" class="tablebody">
  <tr>
    <td><table width="100%" border="0" cellpadding="5" cellspacing="0">
        <tr>
          <th>添 加 文 章</a></span></th>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="1" cellpadding="8">
	<form name="add_news" method="post" action="add_news.asp">
      <input type="hidden" name="hidden" value="ok">
      <tr bgcolor="#F3F5F8">
        <td width="30%" align="right">文 章 类 型:</td>
        <td width="70%"><select name="n_type">
          <option value="情感心灵">情感心灵</option>
          <option value="电子商务">电子商务</option>
          <option value="技术探讨">技术探讨</option>
          <option value="搞笑文章">搞笑文章</option>
          <option value="公告">公告</option>
          <option value="其他">其他</option>
        </select></td>
      </tr>
      <tr bgcolor="#F3F5F8">
        <td width="30%" align="right">标 题:</td>
        <td width="70%"><input name="title" type="text" id="title" size="50"></td>
      </tr>
      <tr bgcolor="#F3F5F8">
        <td align="right">来 自:</td>
        <td><input name="n_from" type="text" id="n_from" size="30"></td>
      </tr>
      <tr bgcolor="#F3F5F8">
        <td align="right">内 容:</td>
        <td><textarea name="content" style="display:none"></textarea>
        <IFRAME ID="eWebEditor1" SRC="eWebEditor/ewebeditor.asp?id=content&style=s_light" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="340"></IFRAME>
        </td>
      </tr>
      <tr bgcolor="#F3F5F8">
        <td height="40" colspan="2" align="center"><input type="submit" name="Submit" value="提 交"> 
             
          <input type="reset" name="Submit2" value="重 置"></td>
      </tr>
	  </form>
    </table></td>
</table>
</body>
</html>