Hi, i need help with this script, because if i check 2 checkboxs, it still telling me that i practice only one sport......
it's a very simple script, i'm just learning php.....
page1.php
<html>
<head>
<title>Problema</title>
</head>
<body>
<form action="pagina2.php" method="post">
Ingrese su nombre:
<br>
<input type="text" name="nombre">
<br>
Qué deportes practica?
<br>
<input type="checkbox" name="futbol">Futbol
<br>
<input type="checkbox" name="basket">Basket
<br>
<input type="checkbox" name="tennis">Tennis
<br>
<input type="checkbox" name="volley">Volley
<br>
<input type="submit" value="Procesar">
</form>
</body>
</html>
page2.php
<html>
<head>
<title>Problema</title>
</head>
<body>
<?php
if (isset($_REQUEST['futbol']))
{
$aff=1;
}
if (isset($_REQUEST['basket']))
{
$aff=1;
}
if (isset($_REQUEST['tennis']))
{
$aff=1;
}
if (isset($_REQUEST['volley']))
{
$aff=1;
}
$cont = $cont + $aff;
echo "<b>Nombre: ".$_REQUEST['nombre']."</b><br>";
echo "Cantidad de deportes que practica: $cont";
?>
</body>
</html>