Ver Mensaje Individual
  #7 (permalink)  
Antiguo 25/10/2003, 17:04
Avatar de cadrogui
cadrogui
 
Fecha de Ingreso: junio-2003
Mensajes: 875
Antigüedad: 20 años, 10 meses
Puntos: 5
lo deje asi pero no funciona me da errores la cookie y no me muestra los resultados....


Código PHP:

<?
if ($Submit){
setcookie("Votada","1");
$voto $_POST["voto"];
echo 
"voto realizado"'<br>';
$conexion=mysql_connect("localhost","cadrogui","mikel");
mysql_select_db("revista",$conexion);
//$voto manda el valor del boton que ha sido pulsado y se asigna a p
$consulta=mysql_query ("update encuesta set p$voto = p$voto+1");

}
if (
$_COOKIE["Votada"]==1) {

mysql_select_db("revista",$conexion);
$con=mysql_query("select * from encuesta");
$img=mysql_fetch_array($con);

$numero =  $img["p1"];
$numero2 $img["p2"];
$numero3 $img["p3"];
$numero4 $img["p4"];

print (
'<img src="img/barra1.gif" width="'.$numero.'" height="9">').'<br>';
print (
'<img src="img/barra2.gif" width="'.$numero2.'" height="9">').'<br>';
print (
'<img src="img/barra3.gif" width="'.$numero3.'" height="9">').'<br>';
print (
'<img src="img/barra4.gif" width="'.$numero4.'" height="9">').'<br>';
} else {
echo 
"aka va el form";
}


?>
me sale esto:

Warning: Cannot add header information - headers already sent by (output started at c:\appserv\www\revista\encu.php:14) in c:\appserv\www\revista\encu.php on line 48
voto realizado
aka va el form

la linea 48:

setcookie("Votada","1");

y no se ke hacer...


salu2
__________________
La mejor manera de aprender es por medio de un aprendizaje significativo....

http://www.cocert.cl