Generala PHP y HTML
Publicado por Tomás (2 intervenciones) el 05/07/2015 21:48:45
Hola,
Necesito hacer una generala en html y php, me vendría bien algo de ayuda o una mano.
Hasta ahora tengo esto:
Lo que faltaría es el funcionamiento en cuanto a la cantidad de tiros, que cuando checkeas un dado no se tire y todo lo que sea para anotar automáticamente. Apreciaría mucho la ayuda.
Espero su respuesta.Muchas Gracias,
Tomás.
Necesito hacer una generala en html y php, me vendría bien algo de ayuda o una mano.
Hasta ahora tengo esto:
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
71
72
73
74
75
76
77
78
79
<html>
<head>
<title>
Generala
</title>
</head>
<?php
$rand1=mt_rand(1,6);
$rand2=mt_rand(1,6);
$rand3=mt_rand(1,6);
$rand4=mt_rand(1,6);
$rand5=mt_rand(1,6);
$aleatorio=array("0","$rand1","$rand2","$rand3","$rand4","$rand5");
$tirar=isset($_REQUEST['tirar'])?$_REQUEST['tirar']:NULL;
$anotar=isset($_REQUEST['anotar'])?$_REQUEST['anotar']:NULL;
if ($tirar=="tiro"){$rand=mt_rand(1,5);}else{$rand="0";};
if ($anotar=="anote"){;}else{;};
?>
<body>
<center>
<form action="index.php" method="post">
<table>
<tr>
<td>
<table>
<?php for($i=1;$i<=5;$i++){ ?>
<tr>
<td>
<?php if($rand=="0") {?>
<input type="image" name="dado.<?php echo $i ?>" value="<?php echo $i ?>" src="img/<?php echo $i ?>.jpg" width="60" height="60">
<input type="checkbox">
<?php }else{?>
<input type="image" name="dado.<?php echo $aleatorio[$i] ?>" value="<?php echo $aleatorio[$i] ?>" src="img/<?php echo $aleatorio[$i] ?>.jpg" width="60" height="60">
<input type="checkbox">
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
</td>
<td>
<table border="1">
<tr>
<td>
</td>
<td>
Jugador
</td>
</tr>
<?php for($e=1;$e<=12;$e++){ ?>
<tr>
<td>
<input type="image" name="anotador" value="<?php echo $e?>" src="img/<?php echo $e?>n.jpg" width="60" height="30">
</td>
<td>
<input type="text" size="5">
</td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
<table>
<tr>
<td>
<input type="hidden" name="tirar" value="<?php echo $tirar ?>">
<button type="submit" name="tirar" style='width:150px; height:50px' value="tiro">Tirar</button>
</td>
<td>
<input type="hidden" name="anotar" value="<?php echo $anotar ?>">
<button type="submit" name="anotar" style='width:150px; height:50px' value="anote">Anotar</button>
</td>
</tr>
</table>
</form>
</body>
</html>
Lo que faltaría es el funcionamiento en cuanto a la cantidad de tiros, que cuando checkeas un dado no se tire y todo lo que sea para anotar automáticamente. Apreciaría mucho la ayuda.
Espero su respuesta.Muchas Gracias,
Tomás.
Valora esta pregunta


0