-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.php
46 lines (31 loc) · 830 Bytes
/
game.php
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
<?php require_once("includes/initialize.php"); ?>
<?php
$numbers = array(1, 2, 4, 8, 16, 32, 64);
echo var_dump($numbers);
if(isset($_POST['submit'])) {
$result = array();
array_push($result, $_POST['number']);
echo array_sum($result) . "<br>";
echo var_dump($result);
} else {
$_POST['number'] = "";
}
?>
<?php require_once("includes/header.php"); ?>
<form action="test.php" method="POST">
<table>
<tr>
<?php
foreach($numbers as $number) { ?>
<td><img src='test/slika<?php echo $number; ?>.gif'></td>
<td>
<input type="radio" name="number" value="<?php $number; ?>" /> YES
<input type="radio" name="number" value="0" /> NO
</td>
<?php } ?>
</tr>
</table>
<br>
<button type="submit" name="submit">Submit</button>
</form>
<?php require_once("includes/footer.php"); ?>