Sql = "Select * from vote where Id = " & id Set Record = RsVote.Execute(Sql) If Not Record.EOF then If (Len(Request.Cookies("stem")(CSTR(id)))) then Dim Valg(9) valg(1) = Record("valg1") valg(2) = Record("valg2") valg(3) = Record("valg3") valg(4) = Record("valg4") valg(5) = Record("valg5") valg(6) = Record("valg6") valg(7) = Record("valg7") valg(8) = Record("valg8") valg(9) = Record("valg9")
response.write font & Record("Beskrivelse") & "<br><br>"
Sql = "Select count(*) as Found from votesvar where VoteId = " & id Set Record = RsVote.Execute(Sql) Ialt = Record("found")
Response.Write "<div align='left'><table border='0'><tr>" For i = 1 to 9 If valg(i) <> "" then Sql = "Select count(*) as Found from votesvar where VoteId = " & id & " and vote = '" & Valg(i) & "'" Set Record = RsVote.Execute(Sql) Procent = 100/Ialt * Record("Found") response.write "<td>" & font & Valg(i) & "</td><td>" & font & Round(procent) & "%</td><td><hr width='" & Procent * faktor & "' size='10' align='left' color='" & barcolor & "'></td></tr>" end if Next Response.Write "</table></div>" Response.Write "<br>" Response.Write "Basert på " & Ialt & " stemmer." else session("retur") = Request.ServerVariables("SCRIPT_NAME") response.write font & Record("Beskrivelse") response.write "<html><head><title>Stem</title></head><body>" response.write "<form method='POST' action='stemreg.asp'>" response.write "<input type='hidden' name='Voteid' value=" & Id & ">" If Record("Valg1") <> "" then response.write "<input type='radio' value='" & Record("Valg1") & "' name='R1'>" & Record("Valg1") & "<br>" end if If Record("Valg2") <> "" then response.write "<input type='radio' value='" & Record("Valg2") & "' name='R1'>" & Record("Valg2") & "<br>" end if If Record("Valg3") <> "" then response.write "<input type='radio' value='" & Record("Valg3") & "' name='R1'>" & Record("Valg3") & "<br>" end if If Record("Valg4") <> "" then response.write "<input type='radio' value='" & Record("Valg4") & "' name='R1'>" & Record("Valg4") & "<br>" end if If Record("Valg5") <> "" then response.write "<input type='radio' value='" & Record("Valg5") & "' name='R1'>" & Record("Valg5") & "<br>" end if If Record("Valg6") <> "" then response.write "<input type='radio' value='" & Record("Valg6") & "' name='R1'>" & Record("Valg6") & "<br>" end if If Record("Valg7") <> "" then response.write "<input type='radio' value='" & Record("Valg7") & "' name='R1'>" & Record("Valg7") & "<br>" end if If Record("Valg8") <> "" then response.write "<input type='radio' value='" & Record("Valg8") & "' name='R1'>" & Record("Valg8") & "<br>" end if If Record("Valg9") <> "" then response.write "<input type='radio' value='" & Record("Valg9") & "' name='R1'>" & Record("Valg9") & "<br>" end if
response.write "<p> <input type='submit' value='Stem' name='B1'></p>" response.write "</form></body></html>" end if else response.write font & "Fejl" end if
response.write "</form></body></html>" end if 'slettes
men det skal nok også lige rettes lidt til sådan den ikke skriver <html> og <head> tags inde midt i det hele. Men er det sådan den bare skal vise det hele?
Problemet mitt er at når jeg har stemt en gang kommer bare resultatet opp når jeg går inn på siden senere. Jeg får ikke muighet til å stemme en gang til.
Slik at hvis det foreksempel er flere i en familie med en pc så kan man bare stemme en gang.
Jeg vil at man skal kunne stemme igjen neste gang man går inn på siden.
Sql = "Select * from vote where Id = " & id Set Record = RsVote.Execute(Sql) If Not Record.EOF then Dim Valg(9) valg(1) = Record("valg1") valg(2) = Record("valg2") valg(3) = Record("valg3") valg(4) = Record("valg4") valg(5) = Record("valg5") valg(6) = Record("valg6") valg(7) = Record("valg7") valg(8) = Record("valg8") valg(9) = Record("valg9")
response.write font & Record("Beskrivelse") & "<br><br>"
Sql = "Select count(*) as Found from votesvar where VoteId = " & id Set Record = RsVote.Execute(Sql) Ialt = Record("found")
Response.Write "<div align='left'><table border='0'><tr>" For i = 1 to 9 If valg(i) <> "" then Sql = "Select count(*) as Found from votesvar where VoteId = " & id & " and vote = '" & Valg(i) & "'" Set Record = RsVote.Execute(Sql) Procent = 100/Ialt * Record("Found") response.write "<td>" & font & Valg(i) & "</td><td>" & font & Round(procent) & "%</td><td><hr width='" & Procent * faktor & "' size='10' align='left' color='" & barcolor & "'></td></tr>" end if Next Response.Write "</table></div>" Response.Write "<br>" Response.Write "Basert på " & Ialt & " stemmer." session("retur") = Request.ServerVariables("SCRIPT_NAME") response.write font & Record("Beskrivelse") response.write "<form method='POST' action='stemreg.asp'>" response.write "<input type='hidden' name='Voteid' value=" & Id & ">" If Record("Valg1") <> "" then response.write "<input type='radio' value='" & Record("Valg1") & "' name='R1'>" & Record("Valg1") & "<br>" end if If Record("Valg2") <> "" then response.write "<input type='radio' value='" & Record("Valg2") & "' name='R1'>" & Record("Valg2") & "<br>" end if If Record("Valg3") <> "" then response.write "<input type='radio' value='" & Record("Valg3") & "' name='R1'>" & Record("Valg3") & "<br>" end if If Record("Valg4") <> "" then response.write "<input type='radio' value='" & Record("Valg4") & "' name='R1'>" & Record("Valg4") & "<br>" end if If Record("Valg5") <> "" then response.write "<input type='radio' value='" & Record("Valg5") & "' name='R1'>" & Record("Valg5") & "<br>" end if If Record("Valg6") <> "" then response.write "<input type='radio' value='" & Record("Valg6") & "' name='R1'>" & Record("Valg6") & "<br>" end if If Record("Valg7") <> "" then response.write "<input type='radio' value='" & Record("Valg7") & "' name='R1'>" & Record("Valg7") & "<br>" end if If Record("Valg8") <> "" then response.write "<input type='radio' value='" & Record("Valg8") & "' name='R1'>" & Record("Valg8") & "<br>" end if If Record("Valg9") <> "" then response.write "<input type='radio' value='" & Record("Valg9") & "' name='R1'>" & Record("Valg9") & "<br>" end if
response.write "<p> <input type='submit' value='Stem' name='B1'></p>" response.write "</form>" else response.write font & "Fejl" end if
Sql = "Select * from vote where Id = " & id Set Record = RsVote.Execute(Sql) If Not Record.EOF then Dim Valg(9) valg(1) = Record("valg1") valg(2) = Record("valg2") valg(3) = Record("valg3") valg(4) = Record("valg4") valg(5) = Record("valg5") valg(6) = Record("valg6") valg(7) = Record("valg7") valg(8) = Record("valg8") valg(9) = Record("valg9")
response.write font & Record("Beskrivelse") & "<br><br>"
Sql = "Select count(*) as Found from votesvar where VoteId = " & id Set Record_count = RsVote.Execute(Sql) Ialt = Record_count("found")
Response.Write "<div align='left'><table border='0'><tr>" For i = 1 to 9 If valg(i) <> "" then Sql = "Select count(*) as Found from votesvar where VoteId = " & id & " and vote = '" & Valg(i) & "'" Set Record_count = RsVote.Execute(Sql) Procent = 100/Ialt * Record_count("Found") response.write "<td>" & font & Valg(i) & "</td><td>" & font & Round(procent) & "%</td><td><hr width='" & Procent * faktor & "' size='10' align='left' color='" & barcolor & "'></td></tr>" end if Next Response.Write "</table></div>" Response.Write "<br>" Response.Write "Basert på " & Ialt & " stemmer." session("retur") = Request.ServerVariables("SCRIPT_NAME") response.write font & Record("Beskrivelse") response.write "<form method='POST' action='stemreg.asp'>" response.write "<input type='hidden' name='Voteid' value=" & Id & ">" If Record("Valg1") <> "" then response.write "<input type='radio' value='" & Record("Valg1") & "' name='R1'>" & Record("Valg1") & "<br>" end if If Record("Valg2") <> "" then response.write "<input type='radio' value='" & Record("Valg2") & "' name='R1'>" & Record("Valg2") & "<br>" end if If Record("Valg3") <> "" then response.write "<input type='radio' value='" & Record("Valg3") & "' name='R1'>" & Record("Valg3") & "<br>" end if If Record("Valg4") <> "" then response.write "<input type='radio' value='" & Record("Valg4") & "' name='R1'>" & Record("Valg4") & "<br>" end if If Record("Valg5") <> "" then response.write "<input type='radio' value='" & Record("Valg5") & "' name='R1'>" & Record("Valg5") & "<br>" end if If Record("Valg6") <> "" then response.write "<input type='radio' value='" & Record("Valg6") & "' name='R1'>" & Record("Valg6") & "<br>" end if If Record("Valg7") <> "" then response.write "<input type='radio' value='" & Record("Valg7") & "' name='R1'>" & Record("Valg7") & "<br>" end if If Record("Valg8") <> "" then response.write "<input type='radio' value='" & Record("Valg8") & "' name='R1'>" & Record("Valg8") & "<br>" end if If Record("Valg9") <> "" then response.write "<input type='radio' value='" & Record("Valg9") & "' name='R1'>" & Record("Valg9") & "<br>" end if
response.write "<p> <input type='submit' value='Stem' name='B1'></p>" response.write "</form>" else response.write font & "Fejl" end if
Det virker på den måten at men får resultatet øverst og valgmulighetene under.
Min hensikt er at man stemmer så kommer resultatet opp. Så neste gang man kommer in på siden kan man stemme igjen. Resultatet skal ikke ligge der altid.
Sql = "Select * from vote where Id = " & id Set Record = RsVote.Execute(Sql) If Not Record.EOF then If session("retur") <> "" then Dim Valg(9) valg(1) = Record("valg1") valg(2) = Record("valg2") valg(3) = Record("valg3") valg(4) = Record("valg4") valg(5) = Record("valg5") valg(6) = Record("valg6") valg(7) = Record("valg7") valg(8) = Record("valg8") valg(9) = Record("valg9")
response.write font & Record("Beskrivelse") & "<br><br>"
Sql = "Select count(*) as Found from votesvar where VoteId = " & id Set Record = RsVote.Execute(Sql) Ialt = Record("found")
Response.Write "<div align='left'><table border='0'><tr>" For i = 1 to 9 If valg(i) <> "" then Sql = "Select count(*) as Found from votesvar where VoteId = " & id & " and vote = '" & Valg(i) & "'" Set Record = RsVote.Execute(Sql) Procent = 100/Ialt * Record("Found") response.write "<td>" & font & Valg(i) & "</td><td>" & font & Round(procent) & "%</td><td><hr width='" & Procent * faktor & "' size='10' align='left' color='" & barcolor & "'></td></tr>" end if Next Response.Write "</table></div>" Response.Write "<br>" Response.Write "Basert på " & Ialt & " stemmer." else session("retur") = Request.ServerVariables("SCRIPT_NAME") response.write font & Record("Beskrivelse") response.write "<html><head><title>Stem</title></head><body>" response.write "<form method='POST' action='stemreg.asp'>" response.write "<input type='hidden' name='Voteid' value=" & Id & ">" If Record("Valg1") <> "" then response.write "<input type='radio' value='" & Record("Valg1") & "' name='R1'>" & Record("Valg1") & "<br>" end if If Record("Valg2") <> "" then response.write "<input type='radio' value='" & Record("Valg2") & "' name='R1'>" & Record("Valg2") & "<br>" end if If Record("Valg3") <> "" then response.write "<input type='radio' value='" & Record("Valg3") & "' name='R1'>" & Record("Valg3") & "<br>" end if If Record("Valg4") <> "" then response.write "<input type='radio' value='" & Record("Valg4") & "' name='R1'>" & Record("Valg4") & "<br>" end if If Record("Valg5") <> "" then response.write "<input type='radio' value='" & Record("Valg5") & "' name='R1'>" & Record("Valg5") & "<br>" end if If Record("Valg6") <> "" then response.write "<input type='radio' value='" & Record("Valg6") & "' name='R1'>" & Record("Valg6") & "<br>" end if If Record("Valg7") <> "" then response.write "<input type='radio' value='" & Record("Valg7") & "' name='R1'>" & Record("Valg7") & "<br>" end if If Record("Valg8") <> "" then response.write "<input type='radio' value='" & Record("Valg8") & "' name='R1'>" & Record("Valg8") & "<br>" end if If Record("Valg9") <> "" then response.write "<input type='radio' value='" & Record("Valg9") & "' name='R1'>" & Record("Valg9") & "<br>" end if
response.write "<p> <input type='submit' value='Stem' name='B1'></p>" response.write "</form></body></html>" end if else response.write font & "Fejl" end if
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.