$max_filesize) die('The file you attempted to upload is too large.'); // Upload the file to your specified path. $newname = substr(sha1(time().$_POST['filename']) ,0, 10).'.'.$ext; if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $newname)) mysql_query ("insert_into 'uploads' (path, userid) values ('$uploadpath', '$userid')") echo ''; echo ''; // Close DB connection mysql_close(); ?>