📄 votesave.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="char.inc"-->
<%IF request.cookies("KEY")<>"super" THEN
response.redirect "index_face.asp"
response.end
else
usernamecookie=CheckStr(request.cookies("UserName"))
passwdcookie=replace(trim(Request.cookies("passwd")),"'","''")
KEYcookie=replace(trim(request.cookies("KEY")),"'","''")
if usernamecookie="" or passwdcookie="" then
response.redirect "login.asp"
response.end
else
'判断用户的合法性
set rs=server.createobject("adodb.recordset")
sql="select * from admin where username='"&usernamecookie&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.redirect "login.asp"
response.end
end if
IF passwdcookie<>rs("passwd") THEN
response.redirect "login.asp"
response.end
END IF
'下面判断用户级别实际在有用户级别是都应该判断
if KEYcookie<>rs("OSKEY") then
response.redirect "index_face.asp"
response.end
end if
rs.close
set rs=nothing
END IF
END IF
if votemana="1" or request.cookies("purview")="99999" then
%>
<%
ID=request.QueryString("id")
Title=trim(request.form("Title"))
act=request("act")
if DateAndTime="" then DateAndTime=now()
Content=trim(request.form("Content"))
founerr=false
if Title="" then
response.write "<script>alert('对不起,投票主题不能为空!');history.go(-1);</Script>"
Response.End
end if
if founderr=true then
call error()
else
set rs=server.createobject("adodb.recordset")
if act="edit" then
sql="select * from vote where ID="&ID
elseif act="add" then
sql="select * from vote"
else
errmsg="<li>操作错误!请联系管理员</li>"
call error()
Response.End
end if
rs.open sql,conn,1,3
if act="add" or act="edit" then
if act="edit" then
if rs.eof then
errmsg="<li>操作错误!请联系管理员</li>"
call error()
Response.End
end if
end if
if act="add" then rs.addnew
rs("Title")=Title
for i=1 to 8
if request("select"&i)<>"" then
rs("select"&i)=request("select"&i)
if request("answer"&i)="" then
rs("answer"&i)=0
else
rs("answer"&i)=request("answer"&i)
end if
end if
next
rs("dateandtime")=now()
rs.update
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Redirect "voteManage.asp"
end if
%>
<%else
response.redirect "index_face.asp"
response.end
end if
%>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -