Google Ads

Simple Drag and Drop Image Upload with MySQL PHP Script


Simple Drag and Drop Image Upload with MySQL PHP Script

The Simple Drag and Drop Image Upload with MySQLi was develop by using MySQLi/jQuery. This simple source code uses jQuery function to process the image when being dragged and dropped into the drop zone. The given source code can teach you on how to drag and drop a simple image to an advanced approach. It is an user friendly kind of source code, feel free to modify it and use it to your project.

This a sample code for displaying the image that been upload

 

<!DOCTYPE html>
<html lang = "en">
<head>
<link rel = "stylesheet" type = "text/css" href = "css/bootstrap.css"/>
<link rel = "stylesheet" type = "text/css" href = "css/style.css"/>
<meta charset = "UTF-8" name= "viewport" content = "width=device-width, initial-scale=1" />
</head>
<body>
<nav class = "navbar navbar-default">
<div class = "container-fluid">
<a class = "navbar-brand" href = "<a href="https://www.sourcecodeter.com">Sourcecodester</a>
" rel="nofollow">https://www.sourcecodeter.com">Sourcecodester</a>
</a> </div>
</nav>
<div class = "row">
<div class = "col-md-3">
</div>
<div class = "col-md-6 well" style = "z-index:99999;">
<h3 class = "text-primary">Drag and Drop Image Upload with MySQLi</h3>
<hr style = "border-top: 1px dotted #8c8b8b;"/>
<a href = "index.php">Back</a>
<table class = "table table-bordered table-hover">
<thead>
<tr>
<th>Image Name</th>
<th>Image</th>
</tr>
</thead>
<tbody>
<?php
$conn = new mysqli('localhost', 'root', '', 'image') or die(mysqli_error());
$stmt= $conn->prepare("SELECT * FROM `photo`") or die(mysqli_error());
if($stmt->execute()){
$result = $stmt->get_result();
}
while($fetch = $result->fetch_array()){
?>
<tr>
<td><?php echo $fetch['photo_name']?></td>
<td><center><img src = "<?php echo 'upload/'.$fetch['photo_name']?>" height = "50px" width = "50px"/></center></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</body>
<script src = "js/jquery-3.1.1.js"></script>
<script src = "js/upload.js"></script>
</html>

I hope that this simple source code can help you to your project and future project. For more updates and tutorials, just kindly visit this site. Enjoy Coding!!

 

 


Related Post

User Login and Management PHP Script User Login and Management PHP Script User Login & Management System is a PHP + MySQLi powered PHP script built up under the CodeIgniter framewo...
NexStats Class v1.3 PHP Script Download NexStats Class v1.3NexStats Class v1.3NexStats Class is a lightweight, easy to use PHP Class. It can easily fetch Search Engine Index Stats Including ...
Count It Round – Standalone PHP Script Downl... Count It Round - StandaloneCount It Round - StandaloneCount It Round is a standalone plugin that allows you easy and fast to create circular countdown...
Frontend template for multipurpose & real est... Frontend template for multipurpose & real estate PHP Script Frontend for multipurpose & real estates is a new frontend for SmartEnd dashboa...
Youtube v3 PHP Script Download 2019 Download a fresh zip of Youtube v3 PHP Script 2019.   How to get activation API Key for Youtube v3 ? Go to Youtube v3 Api Click on (S...

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *