diff --git a/entry.php b/entry.php index ae85142..5945bfe 100644 --- a/entry.php +++ b/entry.php @@ -1,9 +1,11 @@ " . $_POST['tan'] . "<-"; + if($_POST['tan'] != ""){ + addEntry(); + consumeTan($_POST['tan']); + } } function addEntry() { @@ -28,6 +30,11 @@ function consumeTan($tan) { $abfrage = "SELECT `used`, `tan` FROM `tans` WHERE `tan` = '" . $tan . "'"; $ergebnis = mysqli_query($database, $abfrage); + if($ergebnis->num_rows == 0){ + echo "Tan nicht vergeben"; + return; + } + $resultStr = ""; while ($row = $ergebnis->fetch_assoc()) { @@ -51,7 +58,7 @@ function consumeTan($tan) {
- + @@ -65,7 +72,8 @@ function consumeTan($tan) {