Drag and Drop Image Delete using PHP

If you are looking for Drag and Drop Image Delete using PHP and JavaScript then you are at the right place. This simple program created using PHP, MySQL, and JavaScript. The program works by dragging the image to the trash can to deleting image from the database table. Database Name: drag_and_drop

Source Code

In this source code, you can see the images in the gallery and the trash can image as you can see in the image below. Then, source code save it as "index.php". Resultindex.php
  1. <div class="row-fluid">
  2. <div class="span12">
  3.  
  4. <div class="container">
  5. <div class="row">
  6.  
  7. <div class="span8">
  8. <div class="alert alert-alert" style="margin-top:20px;">
  9. <h3>Drag the image to the trash Can to Delete it.</h3>
  10. </div>
  11. <?php
  12. $result = mysql_query("SELECT * FROM image order by id");
  13. while($row=mysql_fetch_assoc($result))
  14. {
  15. echo '<div class="picture"><img class="img-rounded" src="img/'.$row['img'].'" width="128" height="128" class="pngfix" /></div>';
  16. }
  17. ?>
  18. </div>
  19.  
  20. <div class="span4" style="margin-top:20px;">
  21. <div class="content drop-here">
  22. <img src="img/aa.png" class="pngfix" width="128" height="128" />
  23. </div>
  24. </div>
  25.  
  26. </div>
  27. </div>
  28.  
  29. </div>
  30. </div>

Output


This is the form, Result Dragging the image to the trash can. So, this would be the output. Result Kindly click the "Download Code" button below for full source code. Thank you very much. Hope that this tutorial will help you a lot. Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]. Practice Coding. Thank you very much.

Add new comment