Nurmal ein kurzer Schnipsel:
PHP-Code:
<?
//user defined variables
//Absolute path to where images are uploaded. No trailing slash
$abpath1 = "/home/cncboa/newspage/images/";
$abpath2 = "imgdir";
$abpath3 = "/pics";
$abpath = $abpath1 $abpath2 $abpath3
$sizelim = "no"; //Do you want size limit, yes or no
$size = "2500000"; //What do you want size limited to be if there is one
//all image types to upload
$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 = "";
//Checks if file is an image
if (($img3_type == $cert1) or ($img3_type == $cert2) or
($img3_type == $cert3) or ($img3_type == $cert4) or
($img3_type == $cert5) or ($img3_type == $cert6) or
($img3_type == $cert7) or ($img3_type == $cert8) or
($img3_type == $cert9) or ($img3_type == $cert10) or
($img3_type == $cert11) or ($img3_type == $cert12) or
($img3_type == $cert13) or ($img3_type == $cert14) or
($img3_type == $cert15) or ($img3_type == $cert16) or
($img3_type == $cert17)) {
@copy($img3, "$abpath/$img3_name") or $log .= "Couldn't copy image 3 to server<br>";
if (file_exists("$abpath/$img3_name")) {
$log .= "File 3 was uploaded<br>";
}
} else {
$log .= "File 3 is not an image<br>";
}
}
}
Vielleicht bekommst du dann eine Vorstellung davon was PHP ist
