%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<%
Const Path = "asppollx2/"
Dim FS, RS, variables, i, Total, strText
Set FS = server.CreateObject("scripting.filesystemobject")
Set RS = FS.OpenTextFile(server.MapPath("votes.htm"), 1, False)
strText = RS.ReadAll
RS.Close
Set FS = Nothing
Set RS = Nothing
variables = Split(strText, "||")
If Request.Cookies("asppollx2") = variables(0) Then
For i = 1 To UBound(variables) Step 2
Total = Total + CInt(variables(i + 1))
Next
If Total = 0 Then Total = 1
%>
document.write('
');
document.write(' ');
document.write(' ');
document.write(' ');
document.write(' <% =variables(0) %> | ');
<%
For i = 1 To UBound(variables) Step 2
Response.write ("document.write(' " & variables(i) & " | ![]() | " & Round(CInt(variables(i + 1)) / Total * 100, 0) & "% | ');" & vbCrLf)
Next
%>
document.write(' Total Votes: <%=Total%> Thanks for voting | ');
document.write(' ');
document.write(' | ');
document.write('
');
document.write('
');
<% Else %>
document.write('');
document.write(' ');
document.write(' ');
document.write(' ');
document.write(' ');
document.write(' ');
document.write(' | ');
document.write('
');
document.write('
');
<% End If %>