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.
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.
<?php
$conn=new PDO('mysql:host=localhost; dbname=myweb', 'root', '') or die(mysql_error());
if(isset($_POST['submit'])!=""){
$name=$_FILES['photo']['name'];
$size=$_FILES['photo']['size'];
$type=$_FILES['photo']['type'];
$temp=$_FILES['photo']['tmp_name'];
$date = date('Y-m-d H:i:s');
$caption1=$_POST['caption'];
$link=$_POST['link'];
move_uploaded_file($temp,"files/".$name);
$query=$conn->query("INSERT INTO upload (name,date) VALUES ('$name','$date')");
if($query){
header("location:index.php");
}
else{
die(mysql_error());
}
}
?>
Comments
Post a Comment