im new to this and am looking to make a fairly simple script to upload videos and thumbnails then insert video and thumbnail path, title,and date to the db, but its not working on videos.
if I use images, everything works fine, but if I use a video file, it doesnt work...
any ideas? here is the php script
<?php
//connect to database
include_once "../include/connect_to_mysql.php";
//specify redirect URL
$redirect = "success.php";
//then
$imgname = $_FILES["image"]["name"];
$vidname = $_FILES["video"]["name"];
$imgtempname = $_FILES["image"]["tmp_name"];
$vidtempname = $_FILES["video"]["tmp_name"];
//moves file into directory
move_uploaded_file($imgtempname , "../media/videothumbs/" . $imgname);
move_uploaded_file($vidtempname , "../media/videos/" . $vidname);
//then you have to add the names of these files and two other fileds to database
$runtime = $_POST['runtime'];
$title = $_POST['title'];
$description = $_POST['description'];
//ad all the details to database
$query = "INSERT INTO videos (dateAdded, title, runtime, image, description, video) VALUES (now(), '$title', '$runtime', '$imgname', '$description', '$vidname')";
$results=mysql_query($query);
//redirect user
header('Location: '.$redirect); die;
?>
also, here is the form being used:
<form method="post" action="parseVideo.php" enctype="multipart/form-data">
<p><strong>Title:</strong><br>
<input type="text" name="title" id="title" size="80">
</p>
<p><strong>Description:</strong><br>
<input type="text" name="description" id="description" size="100">
</p>
<p><strong>Time (format hh:mm:ss):</strong><br>
<input name="runtime" id="runtime" type="text" size="20">
</p>
<p> </p>
<h2></h2>
<p><strong>Thumbnail Image:</strong><br>
<input type="file" name="image" id="image" size="50" class="textfield2"/>
</p>
<p> </p>
<p><h2></h2> </p>
<p><br>
<strong><font color="#FF0000">Video (flv and mp4 only):</font></strong><br>
<input type="file" name="video" id="video" size="50" class="textfield3">
</p>
<p><input type="submit" name="submit" value="Submit" class="medium awesome">
</form>