You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.5 KiB
60 lines
1.5 KiB
<?php
|
|
require("init.php");
|
|
//ochrana pro zajištění ID
|
|
if (!isset($_GET["id"])){
|
|
header("Location: /");
|
|
}
|
|
|
|
//dynamický $title
|
|
$id = $_GET["id"];
|
|
$title = "Update id:". $id;
|
|
|
|
//příprava k zobrazení dat - snippet pro Select
|
|
$sql = "SELECT id, nazev, autor, rok_vydani FROM intro WHERE id=$id";
|
|
$result = mysqli_query($conn,$sql);
|
|
|
|
if (mysqli_num_rows($result) > 0) {
|
|
while ($row = mysqli_fetch_assoc($result)){
|
|
$nazev = $row["nazev"];
|
|
$autor = $row["autor"];
|
|
$rok_vydani = $row["rok_vydani"];
|
|
}
|
|
} else{
|
|
header("Location: /");
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<link rel="stylesheet" href="css/bootstrap.css">
|
|
|
|
<title><?php echo $title;?></title>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1><?php echo $title;?></h1>
|
|
|
|
<form action="au.php" method="post">
|
|
<input type="text" name="id" disabled
|
|
value="<?php echo $id;?>">
|
|
<input type="text" name="id" hidden
|
|
value="<?php echo $id;?>">
|
|
<input type="text" name="nazev"
|
|
value="<?php echo $nazev;?>">
|
|
<input type="text" name="autor"
|
|
value="<?php echo $autor;?>" >
|
|
<input type="text" name="rok_vydani"
|
|
value="<?php echo $rok_vydani;?>" >
|
|
<input type="submit" value="Update">
|
|
|
|
</form>
|
|
|
|
|
|
</div>
|
|
<script src="js/bootstrap.js"></script>
|
|
</body>
|
|
</html>
|