-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdl_insert.php
More file actions
24 lines (19 loc) · 791 Bytes
/
dl_insert.php
File metadata and controls
24 lines (19 loc) · 791 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
<?php
include 'config.php';
$y_name = $_POST['y_name'];
$address = $_POST['address'];
$p_name = $_POST['p_name'];
$price = $_POST['price'];
$image = $_FILES['image'];
$imageLocation = $image['tmp_name'];
$imageName = $image['name'];
$image_des = "image/" . $imageName;
move_uploaded_file($imageLocation, $image_des);
$insertInfoQuery = "INSERT INTO `dl_infos`(`y_name`, `address`, `p_name`, `price`, `image`) VALUES ('$y_name','$address','$p_name','$price','$image_des')";
if (!mysqli_query($conn, $insertInfoQuery)) {
echo "<script>alert('Product is not inserted !')</script>";
echo "<script>location.href='delivery_details.php'</script>";
} else {
echo "<script>alert('Product is INSERTED !')</script>";
echo "<script>location.href='delivery_details.php'</script>";
}