-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangeimage.php
More file actions
35 lines (30 loc) · 862 Bytes
/
changeimage.php
File metadata and controls
35 lines (30 loc) · 862 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
30
31
32
33
34
35
<?php
session_start();
if (!isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == false) {
header("location: logout_msg.php");
}
$cart_id=$_SESSION['cart_id'];
echo $cart_id;
@$name = $_FILES['file']['name'];
@$size = $_FILES['file']['size'];
@$type = $_FILES['file']['type'];
@$tmp_name = $_FILES['file']['tmp_name'];
if (isset($name)) {
if (!empty($name))
{
$location = 'uploaded/';
if (move_uploaded_file($tmp_name, $location. $name));
$filename= $location . $name;
include "dbConn.php";
$prod_id=$_SESSION['prod_id'];
$cust_id=$_SESSION['cust_id'];
echo $filename;
mysqli_query($db,"update cart_details set image='$filename' where cart_id=$cart_id");
header("Location: cart_details.php");
}
else
{
echo 'Please choose a file';
}
}
?>