Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/11/2009, 20:59
bebo
 
Fecha de Ingreso: octubre-2009
Mensajes: 97
Antigüedad: 14 años, 6 meses
Puntos: 4
Respuesta: Alguna Idea de como hacer esto?

Mas o menos yo pienso asi:

articulo.asp:
Código:
<%ruta="htt"&"p://"&request.servervariables("SERVER_NAME")&request.servervariables("SCRIPT_NAME")&"?votar=true"
if not request("votar")="true" then%>
---Aquí va el articulo o tema--
Califica el artículo:<br>
<img src="no.gif" border=0 onclick="votar('no')" style=cursor:hand> <img src="si.gif" border=0 onclick="votar('si')" style=cursor:hand>
<script>function votar(voto){
var ajax=new ActiveXObject("msxml2.XMLHTTP");
ajax.open("GET","<%=ruta%>&id_articulo=aquivaeliddelarticulo&voto="+voto,false);
ajax.send();
alert(ajax.ResponseText)}</script>
<%else
set rs=server.createobject("adodb.connection")
rs.open "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("aqui va la base de datos")
set seleccion=rs.execute("select * from votos where id_articulo="&request("id_articulo"))
if request("voto")="si" then
rs.execute("update votos set si='"&seleccion("si")+1&"' where id_articulo="&request("id_articulo"))
elseif request("voto")="no" then
rs.execute("update votos set no='"&seleccion("no")+1&"'' where id_articulo="&request("id_articulo"))
response.write "Gracias por votar."
end if%>
Nota: Tu bd deberia llevar las siguientes columnas: id_articulo, si, no