forked from jimit105/Project-Online-Shopping-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd.php
30 lines (20 loc) · 774 Bytes
/
add.php
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
<?php
session_start();
include_once("config.php");
$code = ($_POST['product_code']);
$name = ($_POST['product_name']);
$cat = ($_POST['category']);
$fan = ($_POST['fandom']);
$fees = ($_POST['price']);
$quant = ($_POST['product_qty']);
$sql = "INSERT INTO products(product_code,product_name,category,fandom,price,product_qty) VALUES ('$code','$name','$cat','$fan','$fees','$quant')";
if (mysqli_query($mysqli,$sql)){
echo '<script type="text/javascript">alert("New product added. Add more!");</script>';
header("Location:http://localhost/JIU/add_product.php");
}
else
{
echo '<script type="text/javascript">alert("Error Occured");</script>';
header("Location:http://localhost/JIU/add_product.php");
}
?>