www.gusucode.com > 盐城分类信息网asp源码程序 > admin/addnews.asp
<!--#include file=conn.asp--> <!--#include file=cookies.asp--> <% if request("cnmai")="add" then dim sql,rs,nbiaoti,nfrom,nurl if request("nbiaoti")="" then Response.Write "<script language='javascript'>alert('请输入新闻标题!');history.back();</script>" response.end else nbiaoti=request("nbiaoti") end if if request("nfrom")="" then Response.Write "<script language='javascript'>alert('请输入新闻来源!');history.back();</script>" response.end else nfrom=request("nfrom") end if if request("nurl")="" then Response.Write "<script language='javascript'>alert('请输入链接地址!');history.back();</script>" response.end else nurl=request("nurl") end if set rs=server.createobject("adodb.recordset") sql="select * from [news]" rs.open sql,conn,1,3 rs.addnew rs("nbiaoti")=nbiaoti rs("nfrom")=nfrom rs("nurl")=nurl rs("ndata")=now() rs.update response.write "<p align=""center"">添加新闻成功!</p>" response.write "<meta http-equiv=refresh content=""1;URL=listnews.asp"">" rs.close conn.close set rs=nothing set conn=nothing else %> <link href="inc_style.css" rel="stylesheet" type="text/css"> <title>增加城市新闻</title> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td width="78%"> <div align="center"> <center> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#808080" height="197" width="591"> <FORM name=theForm method=POST action=?cnmai=add> <tr> <td bgColor="#E4E4E4" height="20" vAlign="bottom" style="border-style: solid; border-width: 1" width="517" colspan="2" bordercolor="#C0C0C0"> <p style="MARGIN-LEFT: 6px" align="center"><b>添加城市新闻</b></td> </tr> <tr> <td bgColor="#f7f7f7" height="25" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: solid; border-top-width: 1" align="center" width="98"> <span style="FONT-SIZE: 12px"> 新闻标题:</span></td> <td bgColor="#f7f7f7" height="25" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1"> <input name="nbiaoti" size="67" style="BACKGROUND-COLOR: #f9f9f9; FONT-FAMILY: Verdana; FONT-WEIGHT: bold" tabIndex="1"></td> </tr> <tr> <td bgColor="#f7f7f7" height="25" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium" align="center" width="98"> 新闻来源:</td> <td bgColor="#f7f7f7" height="25" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1" width="491"> <span style="FONT-SIZE: 12px"> <input name="nfrom" size="67" style="BACKGROUND-COLOR: #f9f9f9; FONT-FAMILY: Verdana; FONT-WEIGHT: bold" tabIndex="1"></span></td> </tr> <tr> <td bgColor="#f7f7f7" height="25" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium" align="center" width="98"> 链接地址:</td> <td bgColor="#f7f7f7" height="25" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1" width="491"> <span style="FONT-SIZE: 12px"> <input name="nurl" size="67" style="BACKGROUND-COLOR: #f9f9f9; FONT-FAMILY: Verdana; FONT-WEIGHT: bold" tabIndex="1"></span></td> </tr> <tr> <td bgColor="#f7f7f7" height="25" vAlign="top" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1" colspan="2"> <p align="center"> <button name="B1" type="submit"><u>添加</u></button></td> </tr> </form> </table> </center> </div> </td> </tr> </table> <%end if%>