Browse Source

verwerking shot win/loose

DB
Ruben De Baets 2 years ago
parent
commit
3236c1d71f
2 changed files with 10 additions and 3 deletions
  1. 1
    1
      index.php
  2. 9
    2
      shot.php

+ 1
- 1
index.php View File

@@ -9,7 +9,7 @@
<h1 id="shot">Zeeslag</h1>
<?php

$canal = 30;
$canal = 5;
$sub = rand(0, $canal - 1);
$ammo = $canal / 5;
echo "Sub position: " . $sub;

+ 9
- 2
shot.php View File

@@ -5,8 +5,15 @@
<h2>POST</h2>
Uw schot was:
<?php
echo $_POST['shot'] + 1;
var_dump($_POST);
$canal = 5;
$sub = rand(0, $canal - 1);
$ammo = $canal / 5;
$shot = $_POST['shot'];
if ($shot == $sub) {
echo 'Gewonnen';
} else {
echo "Gemist";
}
?>
</body>


Loading…
Cancel
Save