PHP File Upload
<p>i am building a simple file upload function. the uploaded file should go/store into the "uploads" folder. but they wont go in the folder. Any help? </p>

<p>Below are the code:</p>

<pre><code>&lt;?php

include("connect.php");
$file_name = trim($_POST['file_name']);
$file_size = $_FILES['size'];
$file_type = $_FILES['type'];
$description = trim($_POST['description']);
$date_entered = trim($_POST['date_entered']);

$query = "INSERT INTO uploads (id, file_name, file_size, file_type, description, date_entered)
VALUES ('', '$file_name', '$file_size', '$file_type', '$description', '$date_entered')";
$results = mysql_query($query);

if ($results)
{
  echo "Details added.";

  move_uploaded_file($_FILES[$file_name]['tmp_name'], "uploads/$id");
}

mysql_close();
?&gt;
</code></pre>
