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

📄 admin_mfk_news.asp

📁 一个有用的东西 希望大家喜欢 谢谢大家对本站的支持
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--===============================================================-->
<!--Mfkiqpl旅行社旅游线路预订程序源代码仅供学习或部分旅行社网站用---->
<!--任何单位或个人不得随意修改、截取其中代码或做不法用途------------->
<!--版权归属:mfkiqpl   http://www.zjjnet.com 所有-------------------->
<!--请务必保留以下版权信息------------------------------------------->
<!--作者:mfkiqpl----------------------------------------------------->
<!--QQ:31827726 mail:mfkiqpl@126.com--------------------------------->
<!--主页地址:http://www.zjjnet.com----------------------------------->
<!----------------欢迎各位站长与本人小站进行友情链接----------------->
<!--===============================================================-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
call managemode
dim action
action=trim(request("action"))
select case action
case "edit"
call edit
case "del"
call del
case "editok"
call editok
case else
response.write("<script>alert('错误的参数传递!请确定你从有效链接进入!');history.back();</script>")
end select
sub del
dim id
id=trim(request("id"))
sql="delete * from news where id="&id
conn.execute(sql)
closeconn
response.write("<script>alert('删除新闻成功!按确定重新载入!');location='admin_denews.asp?action=de';</script>")
end sub
sub edit
dim id
id=trim(request("id"))
if id="" or not isnumeric(id) then
response.write("<script>alert('参数传递错误!请确定你从有效链接进入!');history.back();</script>")
end if
set rs=conn.execute("select * from news where id="&id)
if rs.eof or rs.bof then
closeconn
response.write("<script>alert('没有找到相关的新闻!请确定你从有效链接进入!');history.back();</script>")
end if
%>
<script>
function check(){
if(form1.ntitle.value==""){
alert("请输入新闻标题!");
return false;
}
if(form1.ndt.value==""){
alert("请输入新闻加入时间!");
return false;
}
if(form1.ntext.value==""){
alert("请输入新闻内容!");
return false;
}
}
</script>
<table width="618" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<form action="?action=editok" method="post" name="form1" onsubmit="return check();">
  <tr bgcolor="#EFEFEF">
    <td height="26" colspan="2">  编辑新闻 </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="109" height="26" align="center">新闻标题:</td>
    <td width="506" height="26"><input name="ntitle" type="text" id="ntitle" size="40" value="<%=rs("ntitle")%>"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="26" align="center">新闻选项:</td>
    <td height="26">日期:
    <input name="ndt" type="text" id="ndt" size="15" value="<%=rs("ndt")%>">
    置顶:
    <input name="ntop" type="checkbox" id="ntop" value="y"<%if rs("ntop")=1 then response.write ("checked") end if%>>    <input name="id" type="hidden" id="id" value="<%=id%>"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="26" align="center">追加上传:</td>
    <td height="26"><iframe frameborder=0 height="25" marginheight=0 marginwidth=0 scrolling=no width=300 src="upload_news_img.asp"  > </iframe></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="26" align="center">新闻内容:</td>
    <td height="26"><textarea name="ntext" cols="60" rows="12" id="ntext"><%=rs("ntext")%></textarea></td>
  </tr>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="26" colspan="2"><input type="submit" name="Submit" value="确定修改">
      
    <input type="reset" name="Submit2" value="重新载入"></td>
  </tr>
  </form>
</table>
<%
closers(rs)
end sub
sub editok
dim ntitle,ndt,ntop,ntext,id
ntitle=replace(trim(request("ntitle")),"'","")
ndt=replace(trim(request("ndt")),"'","")
ntop=request("ntop")
ntext=replace(request("ntext"),"'","”")
id=trim(request("id"))
if ntop="y" then
ntop=1
else
ntop=0
end if
usql="update news set ntitle='"&ntitle&"',ndt='"&ndt&"',ntop='"&ntop&"',ntext='"&ntext&"' where id="&id
conn.execute(usql)
closeconn
response.write("<script>alert('修改新闻成功!按确定重新载入!');location='admin_denews.asp?action=de';</script>")
end sub
call manageend
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -