-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbooks-add.php
More file actions
33 lines (33 loc) · 804 Bytes
/
books-add.php
File metadata and controls
33 lines (33 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
session_start();
if ((!isset($_SESSION["login"])) || ($_SESSION["auth"] == "0"))
{
?>
<meta http-equiv="refresh" content="0;URL=login.php">
<?php
}
else
{
include("header.php");
?>
<section id="content">
<?php
$bookName = $_POST['bookName'];
$bookWriter = $_POST['bookWriter'];
$situation = $connection->query("insert into books (bookName,bookWriter,bookStatus) values ('$bookName','$bookWriter','0')") or die($lang["Something_bad_happened"]);
if ($situation)
{
$status = "<h2>" . $lang["Process_Successful"] . "</h2>";
}
else
{
$status = "<h2>" . $lang["Process_Failed"] . "</h2>";
}
echo "$status";
echo " <meta http-equiv=\"refresh\" content=\"0;url=books.php\"> ";
?>
</section>
<?php
include("footer.php");
}
?>