Was ist an diesem PHP-Skript falsch?
        echo "<form class='form-signin' style='width:auto!important; max-width: 99%; width:50%!important' method='POST' action='index.php'>";
          echo "<input class='rounded' type='text' placeholder='Grund' name='Owner-grund-$i6'>";
          echo "<input class='rounded' type='number' placeholder='Strafpunkte' name='Owner-points-$i6' step='1'>";
          echo "<button class='btn btn-lg btn-primary btn-block' name='new-strafe-Owner-$i6' type='submit'>Absenden</button>";
        echo "</form>";
      echo "</div>";
      echo "<div class='modal-footer'>";
        echo "<button type='button' class='btn btn-primary' data-dismiss='modal'>Schließen</button>";
      echo "</div>";
    echo "</div>";
  echo "</div>";
echo "</div>";

if (isset($_POST["new-strafe-Owner-$i6"])) {
  $Owner_user_uuid = MojangAPI::getUuid($daten_infos_Team_Owner->name);
  $Owner_by_uuid = MojangAPI::getUuid($username);
  $Owner_user_full_uuid = MojangAPI::formatUuid($Owner_user_uuid);
  $Owner_by_full_uuid = MojangAPI::formatUuid($Owner_by_uuid);
  $Owner_date = date("d.m.y");
  $sql = "INSERT INTO strafe (name, uuid, by_name, by_uuid, grund, punkte, created_at) VALUES ('"
    . $db_Strafe->real_escape_string($daten_infos_Team_Owner->name)
    . "','"
    . $Owner_user_full_uuid
    . "','"
    . $db_Strafe->real_escape_string($username)
    . "','"
    . $Owner_by_full_uuid 
    . "','"
    . $db_Strafe->real_escape_string($_POST["Owner-grund-$i6"])
    . "','"
    . $db_Strafe->real_escape_string($_POST["Owner-points-$i6"])
    . "','"
    . $Owner_date
    . "')";
  $result = mysqli_query($conn_Strafe, $sql);
  $db_Strafe->query('SET @a = 0;');
  $db_Strafe->query('UPDATE strafe SET ID = (@a := @a +1)');
  $db_Strafe->query('ALTER TABLE strafe AUTO_INCREMENT = 1;');

  echo "<meta http-equiv='refresh' content='0; URL=zwischen.php'>";
}

Es wird nicht erkannt, ob das Formular abgesendet wurde.

Mit freundlichen Grüßen

Computer, HTML, Programmieren, PHP
5 Antworten
Weitere Inhalte können nur Nutzer sehen, die bei uns eingeloggt sind.