Uname : Linux V-ShopU01 4.18.0-348.20.1.el8_5.x86_64 #1 SMP Thu Mar 10 20:59:28 UTC 2022 x86_64
Server : Apache/2.4.37 (rocky) OpenSSL/1.1.1k
Whoami : apache
Safe Mode : OFF
DOCUMENT ROOT : /var/www/html/site_shopudietDisable Function :
Path : /var/www/html/site_shopudiet/admin/
Server IP : 65.20.74.164
Client IP : 3.21.246.247
Current File : /var/www/html/site_shopudiet/admin/delete_image.php |
<?php
include 'dbconnect.php';
$id=$_POST['id'];
$file =$_POST['file'];
$name =$_POST['name'];
if($file == 'file1')
{
$sql = mysqli_query($conn,"UPDATE product SET file1='' WHERE id='$id' AND file1='$name'");
$conn->$sql;
echo json_encode($sql);
}
else if($file == 'file2')
{
$sql = mysqli_query($conn,"UPDATE product SET file2='' WHERE id='$id' AND file2='$name'");
$conn->$sql;
echo json_encode($sql);
}
else if($file == 'file3')
{
$sql = mysqli_query($conn,"UPDATE product SET file3='' WHERE id='$id' AND file3='$name'");
$conn->$sql;
echo json_encode($sql);
}
else if($file == 'file4')
{
$sql = mysqli_query($conn,"UPDATE product SET file4='' WHERE id='$id' AND file4='$name'");
$conn->$sql;
echo json_encode($sql);
}
else
{
$sql = mysqli_query($conn,"UPDATE product SET file5='' WHERE id='$id' AND file5='$name'");
$conn->$sql;
echo json_encode($sql);
}
?>