infiltrate
Jeg har denne side : http://www.fredericia-bynight.dk/Statistik.aspmen i stedet for statistik vil jeg jeg gerne have denne kode ind i boksen med Arial og size 2
<%
Set Conn = CreateObject("ADODB.Connection")
Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("poll.mdb"))
strPollID = Request("id"): If strPollID = "" Or Not IsNumeric(strPollID) Then strPollID = "" Else strPollID = CInt(strPollID)
If strPollID > "" Then
If Not Request.Cookies("Poll")(CStr(strPollID)) = "voted" Then
strOptionID = Request("item")
If IsNumeric(strOptionID) Then
Conn.Execute "UPDATE polldata SET itemcount=itemcount+1 WHERE itemid=" & strOptionID & ";"
Response.Cookies("Poll")(CStr(strPollID)) = "voted"
Response.Cookies("Poll").Expires = DateAdd("d", 7, Now) ' // RET HVIS MAN KUN SKAL KUNNE STEMME F.EKS. EN
' // GANG OM UGEN (7 DAGE)
End If
End If
strUrl = Request.ServerVariables("HTTP_REFERER")
If strUrl = "" Then strURL = "poll.asp" ' // RET TIL DIN EGEN DEFEAULT URL!!!
Response.Redirect strUrl
Else
Set Rs = Conn.Execute("SELECT pollid FROM polls;")
If Not Rs.BOF Then
Set Rs = Conn.Execute("SELECT MAX(pollid) FROM polls;"): pollid = CInt(Rs(0))
OptionID = Not (Request.Cookies("Poll")(CStr(pollid)) = "voted")
intPlace = 1
Set Rs = Conn.Execute("SELECT * FROM polls WHERE pollid=" & pollid & ";")
%>
</head>
<font face="Verdana" size="3"><b><%=Rs("polldesc")%></b></font>
<p>
<table border=0 width=400 cellspacing=0 cellpadding=0>
<%
Set Rs = Conn.Execute("SELECT SUM(itemcount) FROM polldata WHERE parent=" & pollid & ";"): Total = Rs(0)
Set Rs = Conn.Execute("SELECT * FROM polldata WHERE parent=" & pollid & ";")
Do Until Rs.EOF Or Rs.BOF
If Total > 0 Then Result = Int((Rs("itemcount") / Total) * 100) Else Result = 0
Select Case OptionID
Case True: %><tr><td width="20"><font face="Verdana" size="2"><%=intPlace%>.</font></td><td width=100%><font face="Verdana" size=2><a href="poll.asp?id=<%=pollid%>&item=<%=Rs("itemid")%>"><b><%=Rs("item")%></b></a></font></td></tr><%
Case False: %><tr><td width="20"><font face="Verdana" size="2"><%=intPlace%>.</font></td><td width=100%><font face="Verdana" size=2><b><%=Rs("item")%></b> (<%=Result%>%)</font></td></tr><%
End Select
Rs.MoveNext
intPlace = intPlace + 1
Loop
Response.Write "</table>"
If Not OptionID Then Response.write "<font face='Verdana' size=2>Antal stemmer: " & Total & "</font>"
Else
Response.Write "Der er ingen afsteminger!"
End If
End If
Set Rs = Nothing
Conn.close: Set Conn = Nothing
%>
