Google Ads

Upload, Download and Delete File using PHP MySQL PHP Script


Upload, Download and Delete File using PHP MySQL PHP Script

In this article, we are going to learn how to create Upload, Download and Delete File using PHP MySQL. This simple program, a user can learn how to code for uploading, downloading, and deleting files using PHP MySQL. This program can serve as your File Manager.
Features

Upload any file
Download your file
Delete your file

Sample Source Code

This PHP source code contains INSERT Statement to save the data into the database.

 

Code:
 
  1. <?php
  2. $conn=new PDO('mysql:host=localhost; dbname=myweb', 'root', '') or die(mysql_error());
  3. if(isset($_POST['submit'])!=""){
  4. $name=$_FILES['photo']['name'];
  5. $size=$_FILES['photo']['size'];
  6. $type=$_FILES['photo']['type'];
  7. $temp=$_FILES['photo']['tmp_name'];
  8. $date = date('Y-m-d H:i:s');
  9. $caption1=$_POST['caption'];
  10. $link=$_POST['link'];
  11. move_uploaded_file($temp,"files/".$name);
  12. $query=$conn->query("INSERT INTO upload (name,date) VALUES ('$name','$date')");
  13. if($query){
  14. header("location:index.php");
  15. }
  16. else{
  17. die(mysql_error());
  18. }
  19. }
  20. ?>

 

 


Related Post

Laraship Form Builder – Drag & Drop Lar... Laraship Form Builder - Drag & Drop Laravel Form Builder With CMS & Admin PHP Script Laraship Form Builder is the ultimate Form Designer an...
Support Ticket System PHP Script Download Support Ticket SystemSupport Ticket SystemThis is very simple support ticket system which is designed to support your customers who have purchased you...
B2Evolution v6.7.5 Stable Blog PHP Script B2Evolution v6.7.5 Stable Blog PHP Script Create a beautiful blog website using this php scrpt. b2evolution is an advanced weblog tool, i-e soft...
PHPfox v3.4.0 Beta 2 PHP Script Download PHPfox v3.4.0 Beta 2 PHP Script Download Create a beautiful Social Network like Facebook, Twitter, Myspace etc. This is a popular PHP Script in ...
Url Pal URL Short Tiny PHP Script Download Url Pal URL Short PHP Script Download Do you already have a short, easy to remember domain name and have no idea what to do next? We’ve got a solut...

Have any Question or Comment?

Leave a Reply

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

"