
<%
on Error Resume Next

'初版可以随意投票
' session("voted")=False
 
'检查本session用户是否已经投过票——一次会面只能投一票
If session("voted")=False Then

  '获取查询目标(ID)
  IDnum=trim(Request.QueryString("ID"))
'   Response.Write "<br>你要查询的是:" & IDnum &"的记录!<br>"
    If IDnum="" Then
        Response.End
    End If  

'打开数据库更新知名度值
   CoStr="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/chi/db/chiwhos.mdb")
   Set Conn=Server.CreateObject("ADODB.Connection")
   Conn.Open CoStr
   CommandText="select ID,FameIndex from man where ID like '" &  IDnum & "'"
   Set rs=Server.CreateObject("ADODB.Recordset")
   rs.Open CommandText,Conn,1,3
  rs("FameIndex")= rs("FameIndex").Value + 1
  rs.Update
  Set rs=nothing
  
  CommandText="insert into manvote(ID,VD,IP) values('" & IDnum & "','"  & now() & "','"   & Request.ServerVariables("REMOTE_ADDR") & "')" 
  Set rs=Conn.Execute(CommandText,1,64)
  Set rs=nothing
  Set Conn=nothing 

'显示投票成功信息并调用投票结果显示模块
%>
<html>

<head>
<base target="main">
<title>池氏宗亲-当代名人录投票结果</title>
</head>

<body TEXT="#000000" ALINK="#003399" topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0" bgcolor="#C0C0C0">
<center>
<%     Response.write "<p> </p><p> </p><p><font face='楷体_GB2312' color='#FF0000'><big>非常感谢您的投票！</big></font></p>10秒后自动跳转查看投票后的结果。"

 session("voted")=True
 Response.Write "<meta http-equiv='refresh' content='10; url=http:\\www.hackchi.com\chi\whoswhov.asp'>"
' Response.Redirect("whoswhov.asp")
Else
Response.write "<body bgcolor='#C0C0C0'><center>"
Response.write "本次登录您已投过票了，请下次再投。"
End If
 %>
</center>
</body>
<html>
