PHP AND UI TRAINING AND DEVELOPMENT

HI,I am Pradeep K. Biswal. having 7+ yrs experience in web development and corporate training.We provide industry driven training on
PHP ,MYSQL,HTML5,CSS3,JQUERY,BOOTSTRAP,ANGUALAR JS.And also provide placement in various MNCs and start up companies after completion of the training programmes.If you are interested to become a UI and Web developer.You can contact me m-8320905181,9777533393.
e-mail-pbiswal46@gmail.com
How to upload and download videos in php. The required scripts are given below.
videoupload1.php
<!DOCTYPE html>
<html>
<body>
<form action="videoupload1.php" method="post" enctype="multipart/form-data">
    Select video to upload:
    <input type="file" name="fileToUpload" id="fileToUpload">
    <input type="submit" value="Upload Image" name="submit">
</form>
<?php
if(isset($_POST['submit']))
{
//$video=$_POST['fileToUpload'];
//$video=$_FILES["fileToUpload"]["name"];
$target_dir = "uploads/";
$target_file= $target_dir . basename($_FILES["fileToUpload"]["name"]);
$con=mysqli_connect("localhost","root","","kmbb");
if(!$con)
{
die("Unable to connect".mysqli_error());
}
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
 if($imageFileType != "mp4" && $imageFileType != "avi" && $imageFileType != "mov" && $imageFileType != "3gp" && $imageFileType != "mpeg")
{
    echo "File Format Not Suppoted";


if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
$name= $_FILES["fileToUpload"]["name"];
mysqli_query($con,"insert into videotable1 values('','$name')");

echo 'video uploaded successfully';
}
mysqli_close($con);
}
?>
</body>

</html>
For  Displaying and downloading videos use the following script.

videoselect.php

<html>
<head>
<style type="text/css">
video
{
/*border:5px solid green;*/
 -webkit-border-image: url('h9.png') 30 round;
/*border-image-width: 20px;*/
border-radius:50%;
}
</style>
</head>
<body bgcolor="maroon">
<?php
$con=mysqli_connect("localhost","root","","kmbb");
if(!$con)
{
die("Unable to connect".mysql_error());
}
$q=mysqli_query($con,"select name from videotable1");
echo '<center><table border="" height="300" width="300" bgcolor="white">';
echo '<tr><th>VIDEOS</th></tr>';
if (mysqli_num_rows($q) > 0)
while($r=mysqli_fetch_assoc($q))
{
echo "<tr>";
echo '<td align="center">'.'<video src="uploads/'.$r['name'].'" height="100" width="300" type="video" controls></video></td>';

echo "</tr>"; 
}
echo '</table></center>';
mysqli_close($con);
?>
</body>
</html>



Comments