% addr0=request.servervariables("server_name") addr1=request.servervariables("url") addr1=replace(addr1,"votedy.asp","") addr="http://"&addr0&addr1 set rs=server.createobject("adodb.recordset") '读取投票项目 if isnull(request("id")) or request("id")="" then set rs=conn.execute("select top 1 * from class order by id desc") vote="vote" else set rs=conn.execute("select * from class where id="&request("id")) vote="vote"&request("id") end if response.write vote&"="&""""&""&""""&chr(10) '如果投票不存在则提示出错 if rs.eof then response.write vote&"="&vote&"+"&""""&"没有该投票;"&""""&chr(10) response.write "document.write ("&vote&");" response.end end if '如果有投票,则读取相关资料 title=rs("title") style=rs("style") classid=rs("id") rs.close '读取选择支 sql="select * from vote where class="&classid rs.open sql,conn,3,1 response.write vote&"="&vote&"+"&""""&"
"&""""&chr(10) response.write vote&"="&vote&"+"&""""&"<\script>function tou"&vote&"(){window.open('about:blank','tou','width=650,height=300,resizable=1,scrollbars=1');form"&vote&".action='"&addr&"votetou.asp?classid="&classid&"&style="&style&"';form"&vote&".target='tou';form"&vote&".submit();}\script>"&""""&chr(10) '释放对象 rs.close set rs=nothing conn.close set conn=nothing response.write "document.write ("&vote&")"&chr(10) %>