-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.php
More file actions
29 lines (23 loc) · 732 Bytes
/
action.php
File metadata and controls
29 lines (23 loc) · 732 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
<?php
include("db-conn.php");
if (isset($_POST['save'])) {
$brand = $_POST['brand'];
$type = $_POST['type'];
$amount = $_POST['amount'];
$color = $_POST['color'];
$owner = $_POST['owner'];
$location = $_POST['location'];
$sql = "INSERT INTO inventaris (brand, type, amount, color, owner, location) VALUES ('$brand', '$type', '$amount', '$color', '$owner', '$location')";
if (mysqli_query($conn, $sql)) {
echo "<script>alert('Has been save');document.location='index.php';</script>";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
}
if (isset($_POST['reset'])) {
header('location: insert.php');
}
if (isset($_POST['back'])) {
header('location: index.php');
}
?>