diff --git a/.gitignore b/.gitignore index 06eaf4e..4a1605b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ /fuel/app/cache/*/* /fuel/app/config/crypt.php +#nezapomenout na ignorování souboru s "citlivými údaji" init.php \ No newline at end of file diff --git a/php-insert-part2/delete.php b/php-insert-part2/delete.php new file mode 100644 index 0000000..4ecb358 --- /dev/null +++ b/php-insert-part2/delete.php @@ -0,0 +1,18 @@ + echo $sql . "
"; + +//vykonání příkazu a následný "report" +if (mysqli_query($conn,$sql)) { + echo "příkaz byl vykonán"; + header("Location: /?del=$id"); +} else { + echo "Error:" .$sql."
". mysqli_errno($conn); +} + + +?> \ No newline at end of file diff --git a/php-insert-part2/index.php b/php-insert-part2/index.php new file mode 100644 index 0000000..3a36d33 --- /dev/null +++ b/php-insert-part2/index.php @@ -0,0 +1,53 @@ + + + + + + + + + + + + +
+
+
+
+ +
+ + Byla vytvořena kniha s ID:".$_GET["id"].""; + } + if (isset($_GET["del"])){ + echo "

Byla odstraněna kniha s ID:".$_GET["del"]."

"; + } + ?> + + + + + + + + \ No newline at end of file diff --git a/php-insert-part2/insert.php b/php-insert-part2/insert.php new file mode 100644 index 0000000..6b6a5d6 --- /dev/null +++ b/php-insert-part2/insert.php @@ -0,0 +1,23 @@ + echo $sql . "
"; +//vykonání příkazu a následný "report" +if (mysqli_query($conn,$sql)) { + $last_id = mysqli_insert_id($conn); + echo "příkaz byl vykonán - ID:" . $last_id; + header("Location: /?id=$last_id"); +} else { + echo "Error:" .$sql."
". mysqli_errno($conn); +} + + +?> \ No newline at end of file