Radio Button dinamicos
Publicado por Oscar Pineda (2 intervenciones) el 16/08/2016 02:29:56
hola, e estado tratando de crear una lista para tomar asistencia pero e tenido problemas con los radio buttons. espero me puedan asesorar gracias ..
el codigo que utilizo es el siguiente.
el codigo que utilizo es el siguiente.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
INCLUDE('conexion.php');
mysql_select_db($bdatos) or die( "Unable to select database");
$query="SELECT * FROM alumno ORDER BY 'nombres' ASC";
$result=mysql_query($query);
$num=mysql_num_rows($result);
?>
<div>
<form method="POST" action="insertar.php" enctype="multipart/form-data">
<table>
<tr>
<td>
Nombre(s)
</td>
<td>
A
</td>
<td>
J
</td>
<td>
F
</td>
</tr>
<?php
$i=0;
while ($i < $num) {
$nombre=mysql_result($result,$i,"nombres");
$ID=mysql_result($result,$i,"id_alumno");
?>
<tr>
<td>
<?php echo $nombre; ?>
</td>
<td>
<label>
<input type="radio" name="opcion" value="asistencia[$i]" checked/>
</label>
</td>
<td>
<label>
<input type="radio" name="opcion" value="justificante[$i]"/>
</label>
</td>
<td>
<label>
<input type="radio" name="opcion" value="falta[$i]"/>
</label>
</td>
</tr>
<?php
$i++;
}
?>
</table>
<input id="Add" type="submit" value="Registrar">
</form>
</div>
</body>
</html>
Valora esta pregunta


0