📄 editballot.asp
字号:
<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
if WS_S.MemberPriv("WS_FrontSetSystem")<>1 then HX_GoBack "对不起,您的权限不够!",""
dim a125_tp,mymode,a125_tp_news1,a125_tp_news2,a125_tp_news3,a125_tp_news4,a125_tp_news5,hit1,hit2,hit3,hit4,hit5,a125_tp_news,hit,sm
dim filtrate,myday
filtrate=true '是否防止重复投票,当为true是启用防止重复投票
myday=1'设置重复投票的天数
function intSql(Numeric)
if IsNumeric(Numeric) then
intSql=Numeric
else
intSql=0
end if
end function
function inthit(Numeric)
If(Numeric="") Then
inthit=1
else
if IsNumeric(Numeric) and Numeric>=1 then
inthit=Numeric
else
inthit=1
end if
End if
end function
Function validpersonal(username,password)
sql="select * from admin where name='"& strSql(username) &"' and pass ='"& strSql(password) &"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
If(rs.eof) Then
validpersonal=false
else
validpersonal=true
End if
End Function
function ChkPost()
dim server_v1,server_v2
chkpost=false
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
chkpost=false
else
chkpost=true
end if
end function
function strtext(str)
strtext=replace(str,chr(34),""")
end function
function strSql(str)
strSql=replace(str,"'","''")
end function
function flashSql(str)
flashSql=replace(str,"chr(124)","|")
end function
If(Request.ServerVariables("REQUEST_METHOD")="POST") Then
a125_tp=request.form("a125_tp")
mymode=request.form("mymode")
a125_tp_news1=request.form("a125_tp_news1")
a125_tp_news2=request.form("a125_tp_news2")
a125_tp_news3=request.form("a125_tp_news3")
a125_tp_news4=request.form("a125_tp_news4")
a125_tp_news5=request.form("a125_tp_news5")
hit1=request.form("hit1")
hit2=request.form("hit2")
hit3=request.form("hit3")
hit4=request.form("hit4")
hit5=request.form("hit5")
a125_tp_news=Array(a125_tp_news1,a125_tp_news2,a125_tp_news3,a125_tp_news4,a125_tp_news5)
hit=Array(hit1,hit2,hit3,hit4,hit5)
If(a125_tp="") Then
sm=sm &"请填写投票主题\n"
End if
If(sm="") Then
sql="delete from a125_tp_news"
set rs=conn.execute(sql)
sql="delete from a125_tp"
set rs=conn.execute(sql)
For i=0 to 4
If(a125_tp_news(i)<>"") Then
sql="insert into a125_tp_news(a125_tp_news,hit) values('"& strSql(a125_tp_news(i)) &"',"& inthit(hit(i)) &")"
set rs=conn.execute(sql)
End if
next
sql="insert into a125_tp(a125_tp,mymode) values('"& strSql(a125_tp) &"',"& mymode &")"
set rs=conn.execute(sql)
sm=sm &"投票修改成功\n"
End if
If(sm<>"") Then
Response.Write "<SCRIPT language=JavaScript>"
Response.Write "alert('"& sm &"');"
Response.Write "</SCRIPT>"
End if
End if
sql="select a125_tp,mymode from a125_tp"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
a125_tp=rs("a125_tp")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>VOTE</title>
<link href="../HXinclude/HX_Style.css" rel="stylesheet" type="text/css">
</head>
<body topmargin='20' leftmargin='0' bottommargin='0'>
<table width='596' border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>在线调查</font></td></tr></table>
<form name="form1" method="post">
<table width='100%' border='0' cellspacing='1' cellpadding='3' bgcolor='#A1BBE0'>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF" class="zw">
<tr bgcolor="#FFFFFF">
<td width="16%">投票主题:
<input name="a125_tp" type="text" class="kuan1" size="25" value="<%=a125_tp%>">
<br>
是否支持多选:
<%if mymode=0 then%>
是
<input name="mymode" type="radio" value="-1" style="border:opx">
否
<input type="radio" name="mymode" value="0" checked style="border:opx">
<%else%>
是
<input name="mymode" type="radio" value="-1" checked style="border:opx">
否
<input type="radio" name="mymode" value="0" style="border:opx">
<%end if%>
</td>
</tr>
<%
sql="select * from a125_tp_news"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
For i=1 to rs.recordcount
%>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td>投票项目<%=i%>:
<input name="a125_tp_news<%=i%>" type="text" class="kuan1" id="name23" size="25" value="<%=strtext(rs("a125_tp_news"))%>">
投票值<%=i%>:
<input name="hit<%=i%>" type="text" class="kuan1" id="name226" size="5" value="<%=rs("hit")%>"></td>
</tr>
<%
rs.movenext
Next
Do While(i<=5)
%>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td>投票项目<%=i%>:
<input name="a125_tp_news<%=i%>" type="text" class="kuan1" id="name32" size="25">
投票值<%=i%>:
<input name="hit<%=i%>" type="text" class="kuan1" id="name2222" size="5"></td>
</tr>
<%
i=i+1
loop
%>
</table></td>
</tr>
<tr bgcolor='#115F8F' class='td4'>
<td height="28" align="center" >
<input name="Submit" type="submit" class="an1" value=" 修 改 ">
<input name="Reset" type="reset" id="Reset" value=" 重置 ">
</td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
<%
rs.Close
set rs=nothing
conn.Close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -