107 funkce + formulář required
This commit is contained in:
@ -2,14 +2,18 @@
|
||||
|
||||
|
||||
global $connection;
|
||||
require "assets/database.php";
|
||||
|
||||
|
||||
if ($_SERVER ["REQUEST_METHOD"] === "POST") {
|
||||
|
||||
require "assets/database.php";
|
||||
|
||||
|
||||
$sgl = "INSERT INTO student (first_name, second_name, age, life, college)
|
||||
VALUES (?, ?, ?, ?, ?)";
|
||||
|
||||
$connection = connectionDB();
|
||||
|
||||
|
||||
$statement = mysqli_prepare($connection, $sgl);
|
||||
|
||||
if ($statement === false) {
|
||||
@ -40,15 +44,15 @@ if ($_SERVER ["REQUEST_METHOD"] === "POST") {
|
||||
<main>
|
||||
<section class="add-form">
|
||||
<form action="pridat-zaka.php" method="POST">
|
||||
<input type="text" name="first_name" placeholder="Křestní jméno">
|
||||
<input type="text" name="first_name" placeholder="Křestní jméno" required>
|
||||
<br>
|
||||
<input type="text" name="second_name" placeholder="Příjmení">
|
||||
<input type="text" name="second_name" placeholder="Příjmení" required>
|
||||
<br>
|
||||
<input type="number" name="age" placeholder="Věk" min="10">
|
||||
<input type="number" name="age" placeholder="Věk" min="10" required>
|
||||
<br>
|
||||
<textarea name="life" placeholder="Podrobnosti o žákovi"></textarea>
|
||||
<textarea name="life" placeholder="Podrobnosti o žákovi" required></textarea>
|
||||
<br>
|
||||
<input type="text" name="college" placeholder="Kolej">
|
||||
<input type="text" name="college" placeholder="Kolej" required>
|
||||
<br>
|
||||
<input type="submit" value="Přidat žáka">
|
||||
</form>
|
||||
|
Reference in New Issue
Block a user