action.asp
来自「采用ASP。NET做的网上游戏交易平台」· ASP 代码 · 共 183 行
ASP
183 行
<!--#include file="dbconn.asp"-->
<!--#include file = "sjcatstudio.inc"-->
<%
function splitstr(str)
str=trim(str)
str=replace(str,"'","")
str=replace(str,";","")
str=replace(str,chr(34),"")
end function
function getFileName(filestr)
dim tmpformat
tmpformat=split(filestr,".")
getFileName="s"&replace(cstr(date()),"-","")&replace(cstr(time()),":","")&"."&tmpformat(1)
end function
'------------------------更改密码处理程序
if request.form("btnUpdatePwd2")<>"" then
if session("userID")="" then
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('您还没有登陆或超时,请登陆!!!');" &vbCrLf&_
"window.location='index.asp';"&vbCrLf&_
"</script>"
end if
dim mynewpwd,mynewpwd2
mynewpwd=request.form("newPwd33")
mynewpwd2=request.form("newPwd22")
'response.write mynewpwd
'response.end
if mynewpwd=mynewpwd2 then
set prs=server.CreateObject("adodb.recordset")
sql="select * from userinfo where username = '"&session("username")&"'"
prs.open sql,conn,3,2
prs("password")=mynewpwd
prs.update
prs.close
set prs=nothing
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('密码修改成功!!!');" &vbCrLf&_
"window.location='password.asp';"&vbCrLf&_
"</script>"
else
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('两次输入的密码不同!!!');" &vbCrLf&_
"history.go(-1);"&vbCrLf&_
"</script>"
response.end
end if
end if
'***********************************************************************************
if request.querystring("key")="delete" then '-------所有删除处理程序
dim myfieldname,mytablename,myidlist,myflagid
'myflagid:0---personal,1---cn_company,2---cnjob,3---news
infoArr=array("请至少选择一条记录","请至少选择一个帐号","请至少选择一个职缺","请至少选择一条新闻")
myfieldname=request.QueryString("fieldname")
mytablename=request.QueryString("tblname")
myidlist=request.QueryString("idlist")
myflagid=cint(request.QueryString("flagid"))
'response.write myfieldname&"--"&mytablename&"--"&myidlist&"--"&myflagid
if myidlist="" then
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('"&infoArr(myflagid)&"');" &vbCrLf&_
"window.location='"&request.servervariables("http_referer")&"';"&vbCrLf&_
"</script>"
elseif instr(myidlist,",")=0 then
sql="delete from "&mytablename&" where "&myfieldname&"="&myidlist
conn.execute(sql)
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('删除成功,按确定返回!');" &vbCrLf&_
"window.location='"&request.servervariables("http_referer")&"';"&vbCrLf&_
"</script>"
else
idArr=split(myidlist,",")
for i=0 to ubound(idArr)
sql="delete from "&mytablename&" where "&myfieldname&"="&idArr(i)
conn.execute(sql)
next
conn.execute(sql)
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('删除成功,按确定返回!');" &vbCrLf&_
"window.location='"&request.servervariables("http_referer")&"';"&vbCrLf&_
"</script>"
end if
end if
if request.querystring("key")="update" then '-------更新发布时间处理程序
if session("userID")="" then
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('您还没有登陆或超时,请登陆!!!');" &vbCrLf&_
"window.location='index.asp';"&vbCrLf&_
"</script>"
end if
myidlist=request.QueryString("idlist")
if myidlist="" then
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('请至少选择一条记录');" &vbCrLf&_
"window.location='"&request.servervariables("http_referer")&"';"&vbCrLf&_
"</script>"
elseif instr(myidlist,",")=0 then
sql="update ziliao set pubDate='"&date()&"' where id="&myidlist
conn.execute(sql)
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('发布时间已经更新,按确定返回!');" &vbCrLf&_
"window.location='"&request.servervariables("http_referer")&"';"&vbCrLf&_
"</script>"
else
idArr=split(myidlist,",")
for i=0 to ubound(idArr)
sql="update ziliao set pubDate='"&date()&"' where id="&idArr(i)
conn.execute(sql)
next
conn.execute(sql)
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('发布时间更新完毕,按确定返回!');" &vbCrLf&_
"window.location='"&request.servervariables("http_referer")&"';"&vbCrLf&_
"</script>"
end if
end if
'------------------------修改交易信息处理程序
if request.form("btnupdate")<>"" then
if session("userID")="" then
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('您还没有登陆或超时,请登陆!!!');" &vbCrLf&_
"window.location='index.asp';"&vbCrLf&_
"</script>"
end if
redim myinfoArr(7)
'myinfoArr(0)=request.form("txtName")
myinfoArr(1)=request.form("sltType2")
myinfoArr(2)=request.form("sltType1")
myinfoArr(3)=request.form("txtTitle")
myinfoArr(4)=request.form("txtMemo")
myinfoArr(4)=replace(myinfoArr(4),"'",chr(32))
myinfoArr(5)=request.form("txtPrice")
myinfoArr(6)=request.form("pt")
myinfoArr(7)=request.form("txtid")
sql="update ziliao set tradeType="&myinfoArr(2)&",infoType="&myinfoArr(1)&",tradeTitle='"&myinfoArr(3)&"',tradeMemo='"&myinfoArr(4)&"',tradePrice="&myinfoArr(5)&",priceType="&myinfoArr(6)&" where id="&myinfoArr(7)
conn.execute(sql)
'response.write sql
'response.end
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('交易信息修改成功!!!');" &vbCrLf&_
"window.opener.location.reload();window.close();" &vbCrLf&_
"</script>"
end if
'--------------------------------
if request.querystring("actionstr")="delbook" then '-------删除留言处理程序
if session("userID")="" then
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('您还没有登陆或超时,请登陆!!!');" &vbCrLf&_
"window.location='index.asp';"&vbCrLf&_
"</script>"
end if
dim mybookid,mytimestr,tmpbook
tmpbook=""
mybookid=request.querystring("bookstr")
mytimestr=request.querystring("timestr")
'response.write request.querystring("actionstr")&"-"&mybookid&"-"&mytimestr
'response.end
set rs=server.CreateObject("adodb.recordset")
sql="select * from ziliao where ID="&clng(mybookid)
rs.open sql,conn,3,1
mybookstr=rs("recommed")
rs.close
set rs=nothing
bookArr=split(mybookstr,"#")
for i=0 to ubound(bookArr)-1
if instr(bookArr(i),mytimestr)=0 then
tmpbook=tmpbook&bookArr(i)&"#"
end if
next
sql="update ziliao set recommed='"&tmpbook&"' where ID="&clng(mybookid)
conn.execute(sql)
Response.Write "<script language=javascript>" &vbCrLf&_
"alert('该留言删除成功!\n按确定返回!!!');" &vbCrLf&_
"window.location='showBook.asp?bookid="&mybookid&"';" &vbCrLf&_
"</script>"
response.end
end if
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?