RE:Tomar valores de boton
FORM METHOD="post" ACTION="zcomida.asp">
<p> </p>
<p align="center"> </p>
<p> </p>
<p> </p>
<p align="center"><img border="0" src="carita.gif" width="93" height="77"></p>
<div align="center">
<center>
<table width="223" border="0" cellspacing="0" cellpadding="0" height="100" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td colspan="3" height="19" width="706">
<p align="center"><font face="Tahoma" size="4"><b>Como Calificas nuestros
<font color="#FF9900">Platillos </font></b></font>
<p align="center"> </td>
</tr>
<tr>
<td width="342" height="20"><font face="Tahoma"><b> Excelente</b></font></td>
<td width="329" height="20"> <input name="mismo" value="1" type="RADIO"></td>
</tr>
<tr>
<td width="342" height="21"><font face="Tahoma"><b> Buena</b></font></td>
<td width="329" height="21">
<input name="mismo" type="Radio" value="2">
</td>
<td width="38" height="21"> </td>
</tr>
<tr>
<td width="342" height="20"><font face="Tahoma"><b> Regular</b></font></td>
<td width="329" height="20">
<input name="mismo" type="Radio" value="3"></td>
</tr>
<tr>
<td width="342" height="1"><font face="Tahoma"><b> Mala</b></font></td>
<td width="329" height="1">
<input name="mismo" type="Radio" value="4">
</td>
<td width="38" height="1"></td>
</tr>
</table>
</center>
</div>
<p
<INPUT TYPE="submit" value="V O T A R !!" style="padding-left: 0; padding-right: 0; padding-top: 0"></p>
</FORM>
</body>
</html>
este es el segundo asp
voto = Request.Form("mismo")
'Conectamos a la BD.
Set oConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("encuestazapata.mdb")
'Con una sentencia SQL pedimos toda la BD.
sql = "SELECT * FROM comida"
RS.Open sql, oConn, 2, 2
'Si es el primer voto de todos, creamos el registro para que los UPDATES funcionen.
'Este IF solo se cumplirá una vez. La primera.
If RS.EOF = True Then
oConn.Execute "INSERT INTO comida(Excelente, Buena, Regular, Mala) VALUES (0,0,0,0)"
RS.Requery
End If
'Comenzamos el chequeo de datos. Para todos igual
If voto = "1" then
'Si se cumple el IF, sumamos uno al campo correspondiente.
oConn.Execute "UPDATE comida SET excelente="&RS.Fields("excelente")+1&""
'La siguiente linea hace un Refresh en la Tabla, para tener los datos recientes.
RS.Requery
Response.Write "<BR>Voto sumado a excelente<BR>"
ElseIf voto = "2" then
oConn.Execute "UPDATE comida SET buena="&RS.Fields("buena")+1&""
RS.Requery
Response.Write "<BR>Voto sumado buena<BR>"
ElseIf voto = "3" then
oConn.Execute "UPDATE comida SET regular="&RS.Fields("regular")+1&""
RS.Requery
Response.Write "<BR>Voto sumado a tal ves<BR>"
ElseIf voto = "4" then
oConn.Execute "UPDATE comida SET mala="&RS.Fields("mala")+1&""
RS.Requery
Response.Write "<BR>Voto sumado a No lo se<BR>"
End If
'Sumamos todos los votos y los guardamos en una variable.
'total = CInt(RS("excelente"))+CInt(RS("buena"))+CInt(RS("regular"))+CInt(RS("mala"))
'Mostrar el gráfico.
'Limpiamos y cerramos todo.
RS.Close
oConn.Close
Set Rs = Nothing
Set oConn = Nothing
End If
Response.Redirect "zservicio1.asp"%>
</BODY>
</HTML>