forked from ringelweb/RingelNew
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostproduct_script.php
57 lines (27 loc) · 1.1 KB
/
postproduct_script.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
require("includes/connect.php");
//ob_start();
$user_name=$_SESSION['user_name'];
$result=mysqli_query($con,"SELECT id FROM users WHERE username='".$user_name."'");
$row=mysqli_fetch_array($result);
$sellerid=$row['id'];
//if(isset($_POST['post'])){
//if(isset($_POST['upload']))
//{
$product_name = $_POST['product_name'];
$description = $_POST['description'];
$category = $_POST['category'];
$quantity = $_POST['quantity'];
$SESSION['quantity']=$quantity;
$target = "img/product_img/".basename($_FILES['image']['name']);
$image= $_FILES['image']['name'];
$query = "INSERT INTO product_info(sellerid, productname, productimage, category, quantity, description)VALUES('$sellerid','$product_name','$image','$category','$quantity','$description')";
echo "<script> alert('hiii'+$query) </script>";
mysqli_query($con, $query);
$_SESSION['sellerid']=$sellerid;
move_uploaded_file($_FILES['image']['tmp_name'], $target);
echo "<script> location.href='home1.php?msg=Hurray!!! You Posted '; </script>";
exit;
//}
//}
?>