this php code:
-----------------------------
//connect to database
include_once "../include/connect_to_mysql.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
$title = $_POST['title'];
$description = $_POST['description'];
//ad all the details to database
$query = "INSERT INTO videos (title, image, description, video) VALUES ($title, $imgname, $desc, $vidname)";
$results=mysql_query($query);
?>
------------------------------
gives these error
-------------------------------
Notice: Undefined index: image in C:xampphtdocsHHUloginvideoUpload.ph… on line 5
Notice: Undefined index: video in C:xampphtdocsHHUloginvideoUpload.ph… on line 6
Notice: Undefined index: image in C:xampphtdocsHHUloginvideoUpload.ph… on line 7
Notice: Undefined index: video in C:xampphtdocsHHUloginvideoUpload.ph… on line 8
Notice: Undefined index: title in C:xampphtdocsHHUloginvideoUpload.ph… on line 13
Notice: Undefined index: description in C:xampphtdocsHHUloginvideoUpload.ph… on line 14
Notice: Undefined variable: desc in C:xampphtdocsHHUloginvideoUpload.ph… on line 16
------------------------------
so here is the breakdown
----------------------------
line:
5 - imgname = $_FILES["image"]["name"];
6 - $vidname = $_FILES["video"]["name"];
7 - $imgtempname = $_FILES["image"]["tmp_name"];
8 - $vidtempname = $_FILES["video"]["tmp_name"];
13 - $title = $_POST['title'];
14 - $description = $_POST['description'];
16 - $query = "INSERT INTO videos (title, image, description, video) VALUES ($title, $imgname, $desc, $vidname)";
Arun
Nice one
0
0
Add Reply