Oh, it doesn't upload the fie.... yeah... are you using php3? $HTTP*VARS has been deprecated a long time. You should be using $POST, $FILES, $GET, $SESSION, $_COOKIE instead. So you'd want to reference your uploaded file like:
$filename = $_FILES['ufile']['name'];
$tmp = $_FILES['ufile']['tmp_name'];
When you want to move the file, use [man]move_uploaded_file/man 😉
Also you've got an undefined constant "none" where you ask if ($ufile != none)... also $ufile sends me the flag that you've got register globals enabled. This isn't a good idea as variables can be easily overwritten that way.
Also, you should use [man]is_uploaded_file/man to check to see if the file is uploaded or not.
Here's your script, as I would use it:
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$fTitle = mysql_escape_string($_POST['fTitle']);
$fDesc = mysql_escape_string($_POST['fDesc']);
$fName = mysql_escape_string($_POST['fName']);
$gName = mysql_escape_string($_POST['gName']);
// Create table in database
mysql_select_db("stuff", $con);
$sql = 'CREATE TABLE IF NOT EXISTS videos (
fTitle varchar(30),
fDesc text,
fName text,
gName text
)';
$result = mysql_query($sql);
if(!$result)
die( mysql_error() ); // No reason to move on if we've got no table
echo "Database Table Created...<br>";
//Inserting Data
mysql_query("INSERT INTO videos (fTitle, fDesc, fName, gName)
VALUES ('$fTitle', '$fDesc', '$fName', '$gName')");
echo "Data Inserted...<br><br>";
//Displaying Data
$result = mysql_query("SELECT * FROM videos");
if(!$result)
echo mysql_error();
echo "<table border='1'>
<tr>
<th>Video Title</th>
<th>Video Description</th>
<th>File Name</th>
<th>Star's Name</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['fTitle'] . "</td>";
echo "<td>" . $row['fDesc'] . "</td>";
echo "<td>" . $row['fName'] . "</td>";
echo "<td>" . $row['gName'] . "</td>";
echo "</tr>";
}
echo "</table>";
echo "<br><br><br>";
$file_name = $_FILES['ufile']['name'];
$path= "uploads/" . $fName;
if(is_uploaded_file($_FILES['ufile']['tmp_name']))
{
if(move_uploaded_file($_FILES['ufile']['tmp_name'], $path))
{
echo "Successful!<BR/>";
echo "File Name:" . $fName . "<BR/>";
echo "File Size: ".$_FILES['ufile']['size']." bytes <BR/>";
echo "File Type:".$_FILES['ufile']['type']."<BR/>";
}
else
{
echo "Error";
}
}
mysql_close();
And one final item, make sure that you define the enctype of the form used for the upload as multipart/form-data; also, make sure that (1) the max_upload_size is large enough for the videos, and (2) the max_memory_size is large enough and (3) the post_size is large enough. If any 1 of those isn't, you can run into issues with uploads in PHP.