io ho modificato solo la dir nel file settings.php, in index.php non ho toccato nulla...
lo script è formato da due files:
settings.php
codice:
<?
// CONFIG FILE
// EDIT THIS FILE TO CUSTOMIZE YOUR SCRIPTS
//
// WRITTEN BY MATTEO FIGUS 2002
// mattfigs@supereva.it
// http://www.matteofigus.cjb.net
// Password
$psw="test";
// Name of the directory where the files will be saved (with slash "/")
// Nome della directory in cui verranno salvati i files (con lo slash "/")
$d="/var/www/vhosts/sito.it/httpdocs/uploads/files/";
// Maximum filesize (bytes - 15000 = 15KB)
// Dimensione massima del file in bytes (15000= 15KB)
$s=150000000000000;
// Uploading.. Message
// Messaggio Trasferimento del file...
$c="Upload in Corso";
// Error Message (Filesize over limit)
// Messaggio di errore (Dimensione del file al di sopra del limite imposto)
$err="ERROR - Filesize over limit";
// Error Message (Not Found, or File-Browse-Box empty)
// Messaggio di errore (Non trovato, o Casella-Sfoglia-file vuota)
$err1="EMPTY";
// OK Message
// Messaggio di OK
$ok="File Caricato Correttamente";
// Go-Back Message
// Messaggio torna-indietro
$back="Uppa Un'altro File";
// Number of simultaneus uploads min=1, max=14
// Numero di uploads simulanei min=1, max=14
$up=1;
// HTML code of the header of the page
// Codice Html dell'header della pagina
?>
<HTML>
<HEAD>
<TITLE>UploadFile</TITLE>
</HEAD>
<STYLE TYPE="text/css">
A { COLOR: RED }
FONT { font-family: Verdana }
</STYLE>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000"><font size=2>
ed index.php
codice:
<?
//
include "settings.php"; /*Inclusion of the config file*/
if ($pp<>''){
$p=base64_encode($pp);
$pp='';
}
if (base64_decode($p)<>$psw){
echo "<FORM METHOD=\"Post\" ACTION=\"$PHP_SELF\">\nInserisci Password: <input type=password name=\"pp\"> <input type=submit value=\"Login\"></FORM>";
} else {
if ($d<>''){
if (!(file_exists($d))){ /*if the dir does not exist...create it*/
umask(011);
mkdir($d,"0777");
echo "The directory $d was successful created.";
}
}
if ($a<>'1'){
echo "<FORM METHOD=\"Post\" ENCTYPE=\"multipart/form-data\" ACTION=\"".$PHP_SELF."?p=".$p."\">\n<input type=hidden name=a value=1>\n";
$k=1;
while ($k<=$up){
echo "File $k: <INPUT TYPE=\"file\" NAME=\"file$k\">
\n";
$k++;
}
echo "<INPUT TYPE=\"submit\" value=UPLOAD>\n</FORM>";
} else {
$k=1;
while ($k<=$up){
echo "$c File $k";
$t=$HTTP_POST_FILES["file$k"]['tmp_name'];
$sz=$HTTP_POST_FILES["file$k"]['size'];
$n=$HTTP_POST_FILES["file$k"]['name'];
if ($t=='none'){
echo ": $err1";
} elseif ($sz>$s){
echo ": $err";
} else {
echo " (IL LINK E' www.sito.it/public/FileUppati/$n): ";
copy($t,"$d$n"); /* Copying the file */
echo $ok;
}
echo "
";
$k++;
}
echo "
<a href=\"$PHP_SELF?p=$p\">$back</a>";
}
}
?>
<body link="#FF00FF" vlink="#FF00FF" alink="#FF00FF" text="#FF00FF" bgcolor="#000000">
<p align="center"><font face="Verdana">Per Conoscere La
Password Contattami
</font><font face="Verdana" color="#008000">
<a href="mailto:info@sito.it?subject=Richiesta Password">
info@elcarlos.it</a></font><font face="Verdana"> </font></p>
<center><font size=1>Created by el_carlos - www.sito.it
</font></center>
</font></body>
</html>