Ver Mensaje Individual
  #9 (permalink)  
Antiguo 07/11/2009, 12:28
letal13
 
Fecha de Ingreso: octubre-2009
Mensajes: 61
Antigüedad: 14 años, 7 meses
Puntos: 0
Respuesta: Alguna Idea de como hacer esto?

ok ya e echo andar el codigo con la siguientes instrucciones

votes.php
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
title>Documento sin título</title>
<
script type="text/javascript">
function 
objetoAjax(){
 var 
xmlhttp=false;
 try {
 
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (
e) {
 try {
 
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 } catch (
E) {
 
xmlhttp false;
 }
 }
 if (!
xmlhttp && typeof XMLHttpRequest!='undefined') {
   
xmlhttp = new XMLHttpRequest();
   }
   return 
xmlhttp;
}

function 
votar(voto){
    
ajax=objetoAjax();
    
ajax.open("GET","vote.php?voto="+voto);
    
ajax.send();
}
</script>
</head>

<body>
<img src="si.gif" border="0" onclick="javascript:votar('si')">
</body>
</html> 
vote.php
Código PHP:
<?php
require("../db_config.php");
$link=conectarse();
$voto $_GET['voto'];
$sql mysql_query("SELECT * FROM news WHERE id_new='1'",$link);
$sqld1 mysql_fetch_array($sql);
if(
$voto == "si"){
    
$votos $sqld1[puntos];
    
$votosd1 $votos+1;
    
mysql_query("UPDATE news SET puntos='$votosd1' WHERE id_new='1'",$link);
}
?>
ahora lo q quiero saber es como le puedo poder que al darle clic en si o en no aparesca un mensaje diciendo que el voto se a agregado con exito

Última edición por letal13; 07/11/2009 a las 23:39