How to remove one or more images from the form
I only have a request, but I don’t know how to connect with deleting a picture, tell me the correct approach.
$c="DELETE FROM `images` WHERE id=$id"; $query1=$dbh->prepare($c); $query1->execute();` <form id="form2" name="upload1" action="exit.php" method="POST" ENCTYPE="multipart/form-data"> <h4 align="center">Загрузка изображения</h4> <center> <input class="btn btn-success" id="zn" type="file" name="userfile[]" multiple accept="image/*" onchange="loadFile(event)"> <br> <input class="btn btn-success" type="submit" name="upload" id="upload" value="Загрузить"><br><br> <p>Предварительный просмотр</p> <img id="output" style="height: 300px; width: 300px; background-size: cover;" ><br></center> <br> <p align="center">Изображение товара</p> <? foreach($rows as $k=>$img){ ?> <img src="<?= $img['name'] ?>" id="output_<?=$k?>" data-id="<?=$img[id]?>" class="mg" style="height: 100px; width: 100px;" > <?}?> <input type="hidden" name="id" value="<?=$row[id]?>"> </form>