monaco
Voice Search Pro
LEVEL 1
300 XP
In this tutorial, we are going to learn how to create Video Uploader using PHP/MySQL. This simple project for video uploader. This project allows the user to upload their desired video and save into the database. The user can upload their video below 15MB or 15 MegaBytes which you can edit the file size limit after downloading the source code.
Creating INSERT Statement
This PHP source code used to insert the desired video uploading by the user.
Creating File Updload - HTML
This HTML source code is used to create input type file.
This is the result:
So what can you say about this work? Share your thoughts in the comment section below or email me at [email protected]. Practice Coding. Thank you very much.
Download
Creating INSERT Statement
This PHP source code used to insert the desired video uploading by the user.
- <?php
- // print_r ($_FILES['file']);
- if
(
isset
(
$_FILES
[
'file'
]
)
)
- {
- $name
=
$_FILES
[
'file'
]
[
'name'
]
;
- $extension
=
explode
(
'.'
,
$name
)
;
- $extension
=
end
(
$extension
)
;
- $type
=
$_FILES
[
'file'
]
[
'type'
]
;
- $size
=
$_FILES
[
'file'
]
[
'size'
]
/
1024
/
1024
;
- $random_name
=
rand
(
)
;
- $tmp
=
$_FILES
[
'file'
]
[
'tmp_name'
]
;
- if
(
$size
>=
15971520
)
- {
- $message
=
"File must not greater than 15mb"
;
- }
- else
- {
- move_uploaded_file
(
$tmp
,
"videos/"
.
$random_name
.
'.'
.
$extension
)
;
- mysqli_query
(
$con
,
"INSERT INTO tbl_video (name,url)
- "
#@%+=FEFGT6R3987EFDF86347GR=+%@#" VALUES('$name', '$random_name.$extension')");
- $message
=
"Video has been successfully uploaded !"
;
- }
- echo
"$message
<br/> <br/>"
;
- echo
"size: $size
mb<br/>"
;
- echo
"random_name: $random_name
<br/>"
;
- echo
"name: $name
<br/>"
;
- echo
"type: $type
<br/><br/>"
;
- }
- ?>
Creating File Updload - HTML
This HTML source code is used to create input type file.
- <form
method
=
"post"
enctype
=
"multipart/form-data"
>
- Select Video : <br
/
>
- <input
name
=
"UPLOAD_MAX_FILESIZE"
value
=
"20971520"
type
=
"hidden"
/
>
- <input
type
=
"file"
name
=
"file"
id
=
"file"
/
>
- <br
/
><br
/
>
- <input
type
=
"submit"
value
=
"Upload"
/
>
- </
form
>
This is the result:

So what can you say about this work? Share your thoughts in the comment section below or email me at [email protected]. Practice Coding. Thank you very much.
Download
You must upgrade your account or reply in the thread to view the hidden content.