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

📄 add_news_ok.asp

📁 不错的ASP整站源代码。在IIS环境下运行都没有问题
💻 ASP
字号:
<!--#include file="../checkuser.asp" -->
<%
 m_ver = Trim(request("ver"))
 if m_ver="cn" then 
  tmpstr_t="[中文版]"
 elseif  m_ver="en"  then 
 tmpstr_t="[英文版]"
 else
 response.write "错误访问页面,请重试" 
 response.end    
 End If%> 
<!--#include file="../../Include/db_conn.asp" -->
<!--#include file="../../Include/pub_func.asp" -->
<%
edit_type=request("edit_type")

if edit_type="add" then    ''当添加新信息时
   	editstr="添加"
	title=request("title")
	content=repSingleQuo(request.Form("content"))
	typeid=request("typeid")
	isnew=request("isnew")
	ishot=request("ishot")
	newdate=request("newsdate")
		
	sqlstr ="insert into ys_news(title,content,typeid,isnew,ishot,newsdate) values("
	sqlstr=sqlstr&"'"&title&"','"&content&"',"&typeid&",'"&isnew&"','"&ishot&"','"&date()&"')"
	conn.execute(sqlstr)
	ok_and_return
elseif edit_type="edit" then  ''当修改信息时
 newsid=request("newsid")
 typeid=request("typeid")
 title=request("title")
 isnew=request.Form("isnew")
 if isnew="" then isnew="0"
  ishot=request.Form("ishot")
 if ishot="" then ishot="0"
  title = request.Form("title")
  content = repSingleQuo(request.Form("content"))
  newsdate=date()
 
 editstr="修改"
   sqlstr ="update ys_news set title='"& title &"',content='"& content &"',typeid="& typeid &",isnew='"& isnew &"',ishot='"& ishot &"' where id="&newsid 
   conn.execute(sqlstr)
   ok_and_return
elseif edit_type="move" then  ''当转移信息时
	editstr="转移"
	newsid=request("newsid")
	mov=cint(request("mov"))
	sqlstr="update ys_news set typeid="& mov &" where id in ("& newsid &")"
	conn.execute(sqlstr)
	ok_and_return

elseif edit_type="del" then   ''当删除信息时
	editstr="删除"
	newsid=request("newsid")
	sqlstr="delete from ys_news where id in (" & newsid & ")"
	conn.execute(sqlstr)
    ok_and_return
end if

call closedb()
%>

<%
  sub ok_and_return
%>
<html>
<head>
<meta http-equiv="refresh" content="1; url=list_news.asp?ver=<%=m_ver%>">
<link href="../include/styles.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>
<table width="100%" height="455" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="100%" align="center"><br>
     <table cellspacing=0 cellpadding=0 width=300 height=100 border=0 ID="Table1">
        <tr><td></td><td align=center ><p>信息<%=editstr%>成功!</p>
            <p>2秒后自动返回</p></td>
        <td></td></tr>
	</table>
  </td>
 </tr>
</table>
</body>
</html>
<%end sub%>

⌨️ 快捷键说明

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