Please help ASAP, this is due real soon.
I am doing a video tube site for a multimedia class, and only have the video insertion script not working. I have no idea what is stopping it and am getting desperate. Am I trying to do too much at once?
name is supposed to be username, although not how to reference from the users table in the db. Will be drawn fron the login in the session ideally, although no idea how.
The video isn’t uploading either. Please help
[php]<?php
if(isset($_POST[‘video’])){
$con=mysql_connect(“localhost”,“xxxxxxxxxx”,“xxxxxx”);
mysql_select_db(“video”,$con);
{
{
$sql = “INSERT INTO video SET
name = '”. mysql_real_escape_string($_POST[‘name’]) ."’,
title = ‘". mysql_real_escape_string($_POST[‘title’]) ."’,
tags = ‘". mysql_real_escape_string($_POST[‘tags’]) ."’,
description = ‘". mysql_real_escape_string($_POST[‘description’]) ."’";
}
$target = “Upload/”;
$target = $target . basename( $_FILES[‘upload_video’][‘title’]) ;
$ok=1;
if(move_uploaded_file($_FILES[‘upload_video’][‘tmp_name’], $target))
{
$query =mysql_query( “INSERT INTO video(video) VALUES (’$target’)”);
echo "The file “. basename($_FILES[‘uploadedfile’][‘name’]). " has been uploaded”;
}
else {
echo “Sorry, there was a problem uploading your file.”;
}
if (!mysqli_query($con,$sql))
{
die('Error: ’ . mysqli_error($con));
}
print(header(“Location: index.php”));
}
}
?> [/php]