H69UNtblNBNpha2dtB1Odn8qYp1Qk5NK2gi7yfceofo9N
/
home
/
ymswebso
/
public_html
/
projectac
/
sitecms
/
process-insert
/
Nama File / Folder
Size
Action
insert-attribute.php
2.368KB
Hapus
Edit
Rename
insert-gallery-image.php
1.644KB
Hapus
Edit
Rename
insert-project-category.php
1.718KB
Hapus
Edit
Rename
insert-video-file.php
1.896KB
Hapus
Edit
Rename
<?php ob_start(); ?> <?php include("../includes/session.php"); ?> <?php include("../includes/login-verify.php"); ?> <?php include("../includes/printmsg.php"); ?> <?php include("../includes/extra-vars.php"); ?> <?php include("../includes/connection.php"); ?> <?php ///// code start here ///// // define variables and set to empty values if ($_SERVER["REQUEST_METHOD"] == "POST") { $selected_folder = form_fields($_POST["selected_folder"]); $video_title = form_fields($_POST["video_title"]); $status = form_fields($_POST["status"]); $modified = form_fields($today); $created = form_fields($today); } function form_fields($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); $data = mysql_real_escape_string($data); return $data; } ///////// fetching the file extension with $imageFileType //////////// $target_dir = "../../uploaded/video/"; $target_file = $target_dir . basename($_FILES["uploaded_video"]["name"]); $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); ////////////////////////////////////////////////// $rand_number = rand(); $file_name = $_FILES['uploaded_video']['name']; $output_file = str_replace(" ","",$file_name); $new_file_name = $rand_number."_".$output_file; $path = "../../uploaded/video/".$new_file_name; if($imageFileType=="mp4" || $imageFileType=="MP4") { move_uploaded_file($_FILES['uploaded_video']['tmp_name'], $path); $uploaded_video = $new_file_name; } else { $uploaded_video = ""; } $sql = "insert into video_gallery (selected_folder, video_title, uploaded_video, status, modified, created)values('$selected_folder', '$video_title', '$uploaded_video', '$status', '$modified', '$created')"; $result = mysql_query($sql); $_SESSION['msg'] = '<div class="alert alert-success text-center"><strong>New video has been uploaded successfully.</strong></div>'; header("location: ../manage-video-gallery?tab=fileupload"); ?> <?php ob_flush(); ?>