PHP-Code:
<?
include ("top.txt");
// Original script developed by the Zach White Network.
// Modifications for flexible multi-indexs developed by
// Greg Johnson
// [email]gjohnson@7south.com[/email]
// 7 South Communications, Inc.
// [url]www.7south.com[/url]
// Mod Date: 11-07-02
//user defined variables
$abpath = "/srv/www/htdocs/web750/html/UPLOADER/FILES"; //Absolute path to where images are indexed. No trailing slash
$sizelim = "yes"; //Do you want size limit, yes or no
$size = "2500000"; //What do you want size limited to be if there is one
$number_of_indexs = 10; //Number of indexs to occur
if ($_REQUEST['submitted']){ // Begin processing portion of script
//all image types to index
$cert1 = "image/pjpeg"; //Jpeg type 1
$cert2 = "image/jpeg"; //Jpeg type 2
$cert3 = "image/gif"; //Gif type
$cert4 = "image/ief"; //Ief type
$cert5 = "image/png"; //Png type
$cert6 = "image/tiff"; //Tiff type
$cert7 = "image/bmp"; //Bmp Type
$cert8 = "image/vnd.wap.wbmp"; //Wbmp type
$cert9 = "image/x-cmu-raster"; //Ras type
$cert10 = "image/x-x-portable-anymap"; //Pnm type
$cert11 = "image/x-portable-bitmap"; //Pbm type
$cert12 = "image/x-portable-graymap"; //Pgm type
$cert13 = "image/x-portable-pixmap"; //Ppm type
$cert14 = "image/x-rgb"; //Rgb type
$cert15 = "image/x-xbitmap"; //Xbm type
$cert16 = "image/x-xpixmap"; //Xpm type
$cert17 = "image/x-xwindowdump"; //Xwd type
$log = "";
for ($i=0; $i<$number_of_indexs; $i++) {
//checks if file exists
if ($img_name[$i] == "") {
$out = $i+1;
$log .= "[b]Foto $out:[/b] Es wurde keine $out. Datei ausgewählt.
";
$log .= "";
}
if ($img_name[$i] != "") {
//checks if file exists
if (file_exists("$abpath/$img_name[$i]")) {
$log .= "Datei $i existiert bereits! Bitte umbenennen
";
} else {
//checks if files to big
if (($sizelim == "yes") && ($img_size[$i] > $size)) {
$log .= "Date $i ist zu groß!
";
} else {
//Checks if file is an image
if (($img_type[$i] == $cert1) or ($img_type[$i] == $cert2) or ($img_type[$i] == $cert3) or ($img_type[$i] == $cert4) or ($img_type[$i] == $cert5) or ($img_type[$i] == $cert6) or ($img_type[$i] == $cert7) or ($img_type[$i] == $cert8) or ($img_type[$i] == $cert9) or ($img_type[$i] == $cert10) or ($img_type[$i] == $cert11) or ($img_type[$i] == $cert12) or ($img_type[$i] == $cert13) or ($img_type[$i] == $cert14) or ($img_type[$i] == $cert15) or ($img_type[$i] == $cert16) or ($img_type[$i] == $cert17)) {
$parts= explode (".", $img_name[$i]);
$fname = rand (10000000000,999999999);
$fname = "$fname.$parts[1]";
@copy($img[$i], "$abpath/$fname") or $log .= "Foto 1 konnte nicht auf den Server geladen werden.
";
if (file_exists("$abpath/$fname")) {
$log .= "Foto $i+1 wurde erfolreich hochgeladen
[url="FILES/$fname"] Klick[/url]
";
flush(); // <------------------- DIESES FLUSCH! ----------------------------
}
} else {
$log .= "Datei $i+1 is keine gültige Bilddatei!
";
}
}
}
}
}
?>
<?
echo "$log";
?>
[url="."]Mehr Dateien hochladen?[/url]
<?
exit;
} // End processing portion of script
?>
<?
for ($j=0; $j<$number_of_indexs; $j++) {
?>
<input type=file name=img[] size=30>
<?
}
?>
<input type="hidden" name="submitted" value="true">
<input type="submit" name="submit" value="Dateien hochladen">
<?
include ("but.txt");
?>
Hey Leute.
Dieses fertige Upload Script wurde von mir durch das
markiert flush ergänzt.
Es wird jedoch völlig ignoriert und ich bekomme alles
ausgaben erst wenn das script fertig gearbeite hat.
Warum?