Stò creando uno script che (oltre a tante altre cose) uploadi anche un file. Alla fine dello script ho inserito queste due istruzioni:
codice:
echo $_FILES['fil']['error'] . "
";
echo "OK";
per essere sicuro che tutto sia andato tutto bene. Sul browser mi ritrovo infatti:
codice:
0
OK
ma il file da uploadare non c' è nella cartella preimpostata. Le impostazioni di PHP per l' upload dei file sono attive.

insins.php
codice:
<?php
include("../config.inc.php");
$use = "cazzo";
$err = "0";
$tit = trim($_POST[tit]);
$sec = $_POST[sec];
$tes = trim($_POST[tes]);
$fil = $_FILES['fil']['name'];
$car = ".";
if (strlen($tit) < 15){echo "Error title
"; ++$err;};
if (strlen($tes) < 25){echo "Error text
"; ++$err;};
if (strstr($fil, $car) == FALSE){echo "Error file
"; ++$err;};
if ($err > 0 ){break;};
$ti = time();

$db = mysql_connect($db_host, $db_user, $db_password);
if ($db == FALSE){echo "Connection error retry later";};
$con = mysql_select_db($db_name, $db);
if ($con == FALSE){echo "Database error retry later";};
$query0 = "select allega from uteinf where userna='$use'";
$q0r = mysql_fetch_array(mysql_query($query0));
if (strstr ($q0r[allega], $fil) != false){echo "File already exist"; break;};
$query1 = "update uteinf set allega='$fil' where userna='$use'";
if (mysql_query($query1) == false){echo "Error rewrite data";};
$query2 = "INSERT INTO fileup (filena, utente) VALUES ('$fil', '$use')";
if (mysql_query($query2) == false){echo "Error insert fileup"; break;};
$query3 = "select id from fileup where filena='$fil'";
$bh = mysql_query($query3);
if ( $bh == false){echo "Error select rename"; break;};
$q3r = mysql_fetch_array($bh);
$nnm = $q3r[id];
$err = copy($_FILES['fil']['tmp_name'], "../fils/".$nnm);
echo $_FILES['fil']['error'] . "
";
echo "OK";
?>
Magari sostituendo il copy con qualcosa di più avanzato...