Microsoft VBScript compilation error '800a03f6'
Can someone help me please!! totally new to scripts but cannot get this to work... i've got no hair left....
error:: Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/admin/includes/common.asp, line 790
script:
<%
'Two varibles are passed into the db
'u_input is the value if the user entered a response to
'the vote/poll question....IP is the address of the user
u_input=request.form("u_input")
u_ip=request.servervariables("remote_addr")
' if the user did not enter anything in the poll on this visit
' then display the poll question and possible choices
if u_input = "" then
%>
<form action="<%= request.servervariables(" method="post" % script_name?)><span style="COLOR: #ffffff">"> </span>
<p><strong>Arts Category<br />
<br />
</strong>
<input type="radio" checked="checked" value="1" name="u_input" />Arts 1<br />
<input type="radio" value="2" name="u_input" />Arts 2<br />
<input type="radio" value="3" name="u_input" />Arts 3<br />
<input type="radio" value="4" name="u_input" />Arts 4<br />
<input type="radio" value="5" name="u_input" />Arts 5<br />
<input type="radio" value="6" name="u_input" />Arts 6<br />
<input type="submit" value="Submit" /></p>
</form>
<%
else
' if the user did input a choice on the vote/ballot
' check to see if their ip address is already in the db
' if the directory your .asp page is in does not have user
' write authority the accessdb variable and access db may
' need to be moved to your /cgi-bin/ directory and add that to the code below
accessdb="arts"
cn="driver={Microsoft Access Driver (*.mdb)};"
cn=cn & "dbq=" & server.mappath(accessdb)
set rs = server.createobject("ADODB.Recordset")
sql = "select ip from ballot where ip ='" & u_ip & "'"
rs.Open sql, cn
if rs.eof then
' if the user has not voted previously indicate it
been_here_before="No"
end if
rs.close
if been_here_before = "No" then
' Since the user has not voted previously their input
' their vote will be added to the db
sql = "insert into ballot (ip, selection" & u_input &") "
sql = sql & "values ('" & u_ip & "',1)"
rs.Open sql, cn
end if
'This will summerize and count the records in the db
sql= "select distinctrow "
sql= sql & "sum(selection1) as sum_selection1, "
sql= sql & "sum(selection2) as sum_selection2, "
sql= sql & "sum(selection3) as sum_selection3, "
sql= sql & "sum(selection4) as sum_selection4, "
sql= sql & "sum(selection5) as sum_selection5, "
sql= sql & "sum(selection6) as sum_selection6, "
sql= sql & "count(*) AS total_votes "
sql= sql & "FROM ballot;"
rs.Open sql, cn
total1=rs ("sum_selection1")
total2=rs ("sum_selection2")
total3=rs ("sum_selection3")
total4=rs ("sum_selection4")
total5=rs ("sum_selection5")
total6=rs ("sum_selection6")
count=rs ("total_votes")
%>
Arts Category <br />
<img height="10" src="black.jpg" width="<%= formatnumber((total1/count)*100,0) %>" />
<%
= formatnumber((total1/count)*100,1)
%>
%<br />
Arts 1 <br />
<img height="10" src="yellow.jpg" width="<%= formatnumber((total2/count)*100,0) %>" />
<%
= formatnumber((total2/count)*100,1)
%>
%<br />
Arts 2 <br />
<img height="10" src="pink.jpg" width="<%= formatnumber((total3/count)*100,0) %>" />
<%
= formatnumber((total3/count)*100,1)
%>
%<br />
Arts 3 <br />
<img height="10" src="blue.jpg" width="<%= formatnumber((total4/count)*100,0) %>" />
<%
= formatnumber((total4/count)*100,1)
%>
%<br />
Arts 4 <br />
<img height="10" src="green.jpg" width="<%= formatnumber((total5/count)*100,0) %>" />
<%
= formatnumber((total5/count)*100,1)
%>
%<br />
Arts 5 <br />
<img height="10" src="red.jpg" width="<%= formatnumber((total6/count)*100,0) %>" />
<%
= formatnumber((total6/count)*100,1)
%>
%<br />
Arts 6 <br />
Total Votes:
<%
= formatnumber(count,0,0)
%>
<br />
<%
end if
%>
</o:p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></?xml:namespace></div></?xml:namespace></p></?xml:namespace></p>
|