<?php 
include 'topmost.php';
if(isset($_POST['item_id'])){ $selectedProduct =getProduct($_POST['item_id']);
$allImg = explode(',',$selectedProduct['item_img']);
unset($allImg[$_POST['item_index']]); unlink($allImg[$_POST['item_index']]);
$sel_img = implode(',',array_values($allImg)); 
QueryDB("UPDATE products SET item_img='$sel_img' where id='".$_POST['item_id']."' ");
// echo 'Selected Image Removed';

}





?>