Ok, il prossimo passp è aggiungere un pò di indentazione e di spazi, così diventa ancora più leggibile 
Codice PHP:
<?php
if(!isset($_POST))
$_POST = $HTTP_POST_VARS;
$self = isset($_SERVER) ? $_SERVER["PHP_SELF"] : $HTTP_SERVER_VARS["PHP_SELF"];
if($_POST["invia"]) { // CONNESSIONE AL MYSQL
@mysql_connect("localhost", "xxx", "xxx") or die("Connessione fallita !");
// SELEZIONE DATABASE @mysql_select_db("my_xxxxx") or die("Selezione Database fallita !");
// MEMORIZZIAMO NELLA VARIABILE $data IL CONTENUTO DEL FILE
$data = addslashes(fread(fopen($_FILES["file_binario"]["tmp_name"], "rb"), $_FILES["file_binario"]["size"]));
// ESEGUIAMO LA QUERY DI INSERIMENTO $result = @mysql_query("INSERT INTO file_binari (Autore, Titolo, Descrizione, DatiBinari, Nome, Size, Type) VALUES ('" . $_POST["Autore"] . "','" . $_POST["Titolo"] . "','" . $_POST["Descrizione"] . "','$data','" . $_FILES["file_binario"]["name"] . "', '" . $_FILES["file_binario"]["size"] . "','" . $_FILES["file_binario"]["type"] . "')") or die("Query di inserimento fallita !");
// ESITO POSITIVO
echo "Il file " . basename($_FILES["file_binario"]["name"]) . " è stato correttamente inserito nel Database.";
// CHIUDIAMO LA CONNESSIONE A MYSQL
@mysql_close();
} else {
echo " <html> <head> <title>Form per l'inserimento</title> </head> <body> <div align=\"center\"> <table> <form action=\"$self\" method=\"POST\" enctype=\"multipart/form-data\" name=\"modulo\"> <tr> <td valign=\"top\">Autore</td> <td><textarea name=\"Autore\" cols=\"40\" rows=\"1\"></textarea></td> </tr> <tr> <td valign=\"top\">Titolo</td> <td><textarea name=\"Titolo\" cols=\"40\" rows=\"1\"></textarea></td> </tr> <tr> <td valign=\"top\">Descrizione </td> <td><textarea name=\"Descrizione\" cols=\"40\" rows=\"5\"></textarea></td> </tr> <tr> <td>File</td> <td><input type=\"file\" name=\"file_binario\" size=\"40\"></td> </tr> <tr> <td colspan=\"2\" valign=\"bottom\" align=\"center\" height=\"30\"> <input type=\"submit\" value=\"Invia il file\" name=\"invia\"></td> </tr> </form> </table> </div> </body> </html> ";
}
?>
Innanzittutto per la scrittura del form ti conviene usare la sintassi heredoc , così sei sicuramente più comodo se vuoi scrivere il form nel codice PHP:
Codice PHP:
echo <<<FORM
<html>
<head>
<title>Form per l'inserimento</title>
<script type="text/javascript">
function validate_required(field,alerttxt) {
if (field.value==null||field.value=="") {
alert(alerttxt);return false;
} else {
return true;
}
}
function validate_form(thisform) {
var autore = document.getElementById('autore');
if (validate_required(autore,"Il campo autore deve essere compilato!")==false) {
autore.focus();
return false;
}
//var titolo, ecc.
}
</script>
</script>
</head>
<body>
<div align="center">
<table>
<form action="$self" method="POST" enctype="multipart/form-data"
name="modulo" onsubmit="return validate_form(this);">
<tr>
<td valign="top">Autore</td>
<td><textarea id="autore" name="Autore" cols="40" rows="1"></textarea></td>
</tr>
<tr>
<td valign="top">Titolo</td>
<td><textarea name="Titolo" cols="40" rows="1"></textarea></td>
</tr>
<tr>
<td valign="top">Descrizione</td>
<td><textarea name="Descrizione" cols="40" rows="5"></textarea></td>
</tr>
<tr>
<td>File</td>
<td><input type="file" name="file_binario" size="40"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" align="center" height="30"><input
type="submit" value="Invia il file" name="invia"></td>
</tr>
</form>
</table>
</div>
</body>
</html>
FORM;
Ti ho scritto un piccolo esempio prendendo spunto da qui. Per ogni campo aggiungi nell'HTML un id, e nel codice javascript il controllo relativo, che può essere molto simile a quello che ti ho scritto per il campo autore. Ricordati però che dovresti fare devi controlli anche lato server con PHP.