Ver Mensaje Individual
  #7 (permalink)  
Antiguo 09/03/2008, 18:08
opzina
 
Fecha de Ingreso: marzo-2008
Mensajes: 1.020
Antigüedad: 16 años, 1 mes
Puntos: 21
Re: (Ayuda) Encuesta algunos errores

encuesta.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=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<?
$servidor = "localhost";
$usuario = "w1070536";
$password = "kuzufiSO13";
$base_de_datos = "w1070536_encuesta";
$conextar=mysql_connect ($servidor,$usuario,$password);
mysql_select_db($base_de_datos);
$sqlupdate = "UPDATE encuestas SET valor$voto = valor$voto+1, total = total+1";
mysql_query($sqlupdate,$conextar);
$sql = "SELECT * FROM encuestas ORDER BY idencuesta desc LIMIT 1";
$resultados = mysql_query($sql,$conextar);
$row = mysql_fetch_array($resultados);
?>
<script type="text/javascript" language="JavaScript">
function resultados(){
window.open("resultados.php","","toolbar=0,locatio n=0,directories=0,status=0,menubar=0,scrollbars=0, resizable=0,width=320,height=200");
}
</script>
<form name="form1" method="post" action="<?= $PHP_SELF?>">
<table width="256" border="0" align="center" cellpadding="0" cellspacing="0" class="forumline">
<tr valign="baseline">
<td colspan="2" class="row1">
<?=$row['¿Quién ganará el torneo?']; ?>
<br>
</td>
</tr>
<tr>
<td width="110">
<?=$row['Boca'];?>
Boca</td>
<td width="146"><input type="radio" name="voto" value="1">
</td>
</tr>
<tr>
<td>
<?=$row['River'];?>River
</td>
<td><input type="radio" name="voto" value="2"></td>
</tr>
<tr>
<td>
<?=$row['Lanus'];?>Lanus
</td>
<td><input type="radio" name="voto" value="3"></td>
</tr>
<tr align="center">
<td height="20" colspan="2"><input type="submit" class="post"name="Submit" value="Votar" onClick=window.open("resultados.php","","toolbar=0 ,location=0,directories=0,status=0,menubar=0,scrol lbars=0,resizable=0,width=320,height=200");
></td>
</tr>
</table>
<p>&nbsp;</p></form>
</body>
</html>