$MAXDIM[$tipo]) { $errore = $ERR_DIM; } } } // Inizio a processare i files inviati if ($errore == $NOERR) { // Creo la struttura di directory ed il percorso del file $outpath = "$PATH_MEDIA/$community"; if(!is_dir($outpath)) mkdir($outpath, 0777); $outpath = $outpath . "/" . $nickname{0}; if(!is_dir($outpath)) mkdir($outpath, 0777); $outpath = $outpath . "/" . substr($nickname , -2); if(!is_dir($outpath)) mkdir($outpath, 0777); $outpath = $outpath . "/" . $nickname; if(!is_dir($outpath)) mkdir($outpath, 0777); $outpath = $outpath . "/" . $nickname . ","; $outfile = $outpath . $profilo . "." . $estensione; // Copia del file if (copy($_FILES[file][tmp_name] , $outfile ) ) { //La copia del file nella directory di destinazione è avvenuta correttamente // Creazione dei ThumbNail if ($tipothumbnail >> 0) { $thumbfile = $outpath . "i" . substr($profilo , -2) . ".jpg"; $esegui="convert -colorspace RGB -quality " . $TQUALITY . " -geometry 64x64 " . $outfile . "[0] " . $thumbfile; exec($esegui); if ($tipothumbnail >> 1) { $thumbfile = $outpath . "t" . substr($profilo , -2) . ".jpg"; $esegui="convert -colorspace RGB -quality " . $TQUALITY . " -geometry 160x160 " . $outfile . "[0] " . $thumbfile; exec($esegui); } } // Creo il file HTML $fileout=fopen ("$outpath$profilo.html" ,"w"); if($fileout) { fwrite($fileout,"\n"); fwrite($fileout,"\n"); fwrite($fileout,"\n"); fwrite($fileout,""); fclose($fileout); } // Cancella eventuali versioni obsolete del file for ($ne = 0; $ne <= 12; $ne++ ) { if ($ESTENSIONI[$tipo][$ne] != $estensione and is_file($outpath . $profilo . "." . $ESTENSIONI[$tipo][$ne])) { unlink($outpath . $profilo . "." . $ESTENSIONI[$tipo][$ne]); } } // Crea il path da caricare sul profile manager $filename = "/contenuti/$nickname,$profilo.$estensione"; } else { //Errore nella copia del file; $errore = $ERR_UPLOAD; } } // Redirect verso la URL di ritorno if ($errore == $NOERR) { $ret_url = $urlok."nickname=$nickname&path=$filename&errore=$errore&tipo=$_POST[tipo_file]&des=$des_foto"; } else { $ret_url = $urlnok."nickname=$nickname&path=&errore=$errore"; } header("Location: $ret_url"); // Funzioni utilizzate per estrarre l'elenco dei nicknames dal cookie di AAA function recupero_dati($namedato,$cookie){ $stringa=Myhex2bin($cookie); $stringa = encoding_cookie($stringa); $app = explode(":", $stringa); $appcount = count($app); $toFind = "="; for($i=0;$i<$appcount;$i++) { $stringA = $app[$i]; $lenstringaA = strlen($app[$i]); $result = strchr($stringA,$toFind); if ($result!= ""){ $lentoFind = strlen($result); //prima parte del cookie $firststr = substr($stringA, 0, -$lentoFind); if ($firststr == $namedato){ $strdato = substr($result, 1); } } } return $strdato; } function Myhex2bin($param) { $final=""; for($i=0;$i