<% Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 %> <% Const Path = "asppollx5/" 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("asppollx5") = 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('
'); document.write(' '); document.write(' '); <% For i = 1 To UBound(variables) Step 2 Response.write ("document.write(' ');" & vbCrLf) Next %> document.write(' '); document.write('

<% =variables(0) %>

" & variables(i) & "

" & Round(CInt(variables(i + 1)) / Total * 100, 0) & "%

Total Votes: <%=Total%>
Thanks for voting

'); document.write('
'); <% Else %> document.write(''); document.write(' '); document.write(' '); document.write(' '); document.write('
'); document.write(' '); document.write(' '); document.write(' '); <% For i = 1 To UBound(variables) Step 2 Response.write ("document.write(' ');") Next %> document.write(' '); document.write(' '); document.write('

<% =variables(0) %>

" & variables(i) & "

 
Results

'); document.write('
'); <% End If %>