forked from aemunahmar/DBProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewPackages.php
More file actions
23 lines (19 loc) · 852 Bytes
/
newPackages.php
File metadata and controls
23 lines (19 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
session_start();
include('dbconnect.php');
$package = filter_input(INPUT_POST, 'package');
$description = filter_input(INPUT_POST, 'description');
$price = filter_input(INPUT_POST, 'price');
$mode = filter_input(INPUT_POST, 'mode');
$connection = mysqli_connect("127.0.0.1", "root", "", "globalviews");
$sql = "INSERT INTO add_on (package_no, package_description, price, mode_available)
VALUES ('$package', '$description', '$price', '$mode')";
if ($connection->query($sql) === TRUE)
{
echo "<script>alert('New Package Added'); window.location.href='empAccount.html';</script>";
} else
{
//echo "Something went wrong" . "<br>" . $connection->error;
echo "<script>alert('Package already exists'); window.location.href='addPackages.html';</script>";
}
?>