Hallo,
Ich möchte für folgendes Skript die Größe auf maximal 100 KB (minimal 10 KB bereits eingestellt) und die Dateiarten auf .jpg und .gif beschränken.
Download-Link:
http://www.ectona.org/download/?id=70&s=download
Skript:
<HTML>
<?php
///////////////////////////////////////////////
// //
// Uploader v.1 //
// ----------------------------------------- //
// by Graeme (webmaster@phpscriptcenter.com) //
// http://www.phpscriptcenter.com //
// //////////////////////////////
// PHP Script CENTER offers no warranties on this script. //
// The owner/licensee of the script is solely responsible for any //
// problems caused by installation of the script or use of the script //
// //
// All copyright notices regarding Uploader, must remain //
// intact on the scripts and in the HTML for the scripts. //
// //
// (c) Copyright 2001 PHP Script CENTER //
// //
// For more info on Uploader, //
// see http://www.phpscriptcenter.com/uploader.php3 //
// //
///////////////////////////////////////////////////////////////////////////
require("setup.php3");
echo $body;
if($doupload) {
if($ADMIN[RequirePass] == "Yes") {
if($password != "$ADMIN[Password]") {
echo("<P><CENTER><B><FONT FACE=\"Verdana\">Fehler</FONT></B></CENTER></P>
<P><CENTER><TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"0\"
CELLPADDING=\"0\">
<TR>
<TD WIDTH=\"100%\" BGCOLOR=".$bgcolor.">
<TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"2\">
<TR>
<TD COLSPAN=\"2\" BGCOLOR=".$bgcolor2.">
<FONT COLOR=".$fcolor." SIZE=\"-1\" FACE=\"Verdana\">Falsches Password</FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER><FONT SIZE=\"-2\" FACE=\"Verdana\"><A HREF=\"http://www.phpscriptcenter.com/uploader.php3\" TARGET=\"_blank\">Uploader</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\"http://www.phpscriptcenter.com/\" TARGET=\"_blank\">PHPScriptCENTER.com</A></FONT></CENTER>
</BODY>
</HTML>");
exit();
}
}
$num = 0;
while($num < $ADMIN[UploadNum]) {
$num++;
$picture = "fileup$num"."_name";
$picture1 = $$picture;
$picture2 = "fileup$num";
$picture3 = $$picture2;
if($picture3 != "none") {
$filesizebtyes = filesize($picture3);
$ok = 1;
if($filesizebtyes < 10) {
$error .= "Datei Nr.$num ist kleiner als 10 kb.<BR>";
$ok = 2;
}
if(file_exists("$ADMIN[directory]/$picture1") OR $ok == 2) {
$error .="Die Datei Nr.$num existiert bereits auf dem Server.<BR>";
} else {
copy ($picture3, "$ADMIN[directory]/$picture1");
$error .="Datei Nr.$num wurde hochgeladen.<BR>";
}
}
}
if(!$error) {
$error .= "Es wurde keine Datei ausgewählt.";
}
echo("<P><CENTER><B><FONT FACE=\"Verdana\">Status</FONT></B></CENTER></P>
<P><CENTER><TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"0\"
CELLPADDING=\"0\">
<TR>
<TD WIDTH=\"100%\" BGCOLOR=".$bgcolor.">
<TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"2\">
<TR>
<TD COLSPAN=\"2\" BGCOLOR=".$bgcolor2.">
<FONT COLOR=".$fcolor." SIZE=\"-1\" FACE=\"Verdana\">$error</FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER><FONT SIZE=\"-2\" FACE=\"Verdana\"><A HREF=\"http://www.phpscriptcenter.com/uploader.php3\" TARGET=\"_blank\">Uploader</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\"http://www.phpscriptcenter.com/\" TARGET=\"_blank\">PHPScriptCENTER.com</A></FONT></CENTER>
</BODY>
</HTML>");
exit();
} else {
$num = 0;
while($num < $ADMIN[UploadNum]) {
$num++;
$html .= "<TR>
<TD WIDTH=\"25%\" BGCOLOR=".$tcolor.">
<FONT COLOR=\"#ffffff\" SIZE=\"-1\" FACE=\"Verdana\">File $num:</FONT></TD>
<TD WIDTH=\"75%\" BGCOLOR=".$bgcolor.">
<INPUT NAME=\"fileup$num\" TYPE=\"file\" SIZE=\"25\">
</TD> ";
}
if($ADMIN[RequirePass] == "Yes") {
$passhtml = "<P><CENTER><TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">
<TR>
<TD WIDTH=\"100%\" BGCOLOR=".$bgcolor.">
<TABLE WIDTH=\"300\" BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"2\">
<TR>
<TD WIDTH=\"33%\" BGCOLOR=".$tcolor.">
<B><FONT COLOR=".$fcolor." SIZE=\"-1\" FACE=\"Verdana\">Password:</FONT></B></TD>
<TD WIDTH=\"67%\" BGCOLOR=".$bgcolor2.">
<INPUT NAME=\"password\" TYPE=\"password\" SIZE=\"25\">
</TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P>";
}
echo("<FORM ENCTYPE=\"multipart/form-data\" ACTION=\"uploader.php3\" METHOD=\"POST\">
<P><CENTER><B><FONT FACE=\"Verdana\">Upload</FONT></B></CENTER></P>
<P><CENTER><TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">
<TR>
<TD WIDTH=\"100%\" BGCOLOR=".$bgcolor.">
<TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"2\">
<TR>
<TD COLSPAN=\"2\" BGCOLOR=".$tcolor2.">
<B><FONT COLOR=".$fcolor." SIZE=\"-1\" FACE=\"Verdana\">Wähle Dateien</FONT></B></TD>
</TR>$html
</TABLE></TD>
</TR>
</TABLE></CENTER></P>$passhtml<P><CENTER><INPUT NAME=\"doupload\" TYPE=\"submit\" VALUE=\"Hochladen\"></CENTER></FORM>
<P><CENTER> </CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER><FONT SIZE=\"-2\" FACE=\"Verdana\"><A HREF=\"http://www.ectona.com\" TARGET=\"_blank\">Uploader</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\"http://www.phpscriptcenter.com/\" TARGET=\"_blank\">PHPScriptCENTER.com</A></FONT></CENTER>
</BODY>
</HTML>");
exit();
}
php?>
Ich möchte für folgendes Skript die Größe auf maximal 100 KB (minimal 10 KB bereits eingestellt) und die Dateiarten auf .jpg und .gif beschränken.
Download-Link:
http://www.ectona.org/download/?id=70&s=download
Skript:
<HTML>
<?php
///////////////////////////////////////////////
// //
// Uploader v.1 //
// ----------------------------------------- //
// by Graeme (webmaster@phpscriptcenter.com) //
// http://www.phpscriptcenter.com //
// //////////////////////////////
// PHP Script CENTER offers no warranties on this script. //
// The owner/licensee of the script is solely responsible for any //
// problems caused by installation of the script or use of the script //
// //
// All copyright notices regarding Uploader, must remain //
// intact on the scripts and in the HTML for the scripts. //
// //
// (c) Copyright 2001 PHP Script CENTER //
// //
// For more info on Uploader, //
// see http://www.phpscriptcenter.com/uploader.php3 //
// //
///////////////////////////////////////////////////////////////////////////
require("setup.php3");
echo $body;
if($doupload) {
if($ADMIN[RequirePass] == "Yes") {
if($password != "$ADMIN[Password]") {
echo("<P><CENTER><B><FONT FACE=\"Verdana\">Fehler</FONT></B></CENTER></P>
<P><CENTER><TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"0\"
CELLPADDING=\"0\">
<TR>
<TD WIDTH=\"100%\" BGCOLOR=".$bgcolor.">
<TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"2\">
<TR>
<TD COLSPAN=\"2\" BGCOLOR=".$bgcolor2.">
<FONT COLOR=".$fcolor." SIZE=\"-1\" FACE=\"Verdana\">Falsches Password</FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER><FONT SIZE=\"-2\" FACE=\"Verdana\"><A HREF=\"http://www.phpscriptcenter.com/uploader.php3\" TARGET=\"_blank\">Uploader</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\"http://www.phpscriptcenter.com/\" TARGET=\"_blank\">PHPScriptCENTER.com</A></FONT></CENTER>
</BODY>
</HTML>");
exit();
}
}
$num = 0;
while($num < $ADMIN[UploadNum]) {
$num++;
$picture = "fileup$num"."_name";
$picture1 = $$picture;
$picture2 = "fileup$num";
$picture3 = $$picture2;
if($picture3 != "none") {
$filesizebtyes = filesize($picture3);
$ok = 1;
if($filesizebtyes < 10) {
$error .= "Datei Nr.$num ist kleiner als 10 kb.<BR>";
$ok = 2;
}
if(file_exists("$ADMIN[directory]/$picture1") OR $ok == 2) {
$error .="Die Datei Nr.$num existiert bereits auf dem Server.<BR>";
} else {
copy ($picture3, "$ADMIN[directory]/$picture1");
$error .="Datei Nr.$num wurde hochgeladen.<BR>";
}
}
}
if(!$error) {
$error .= "Es wurde keine Datei ausgewählt.";
}
echo("<P><CENTER><B><FONT FACE=\"Verdana\">Status</FONT></B></CENTER></P>
<P><CENTER><TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"0\"
CELLPADDING=\"0\">
<TR>
<TD WIDTH=\"100%\" BGCOLOR=".$bgcolor.">
<TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"2\">
<TR>
<TD COLSPAN=\"2\" BGCOLOR=".$bgcolor2.">
<FONT COLOR=".$fcolor." SIZE=\"-1\" FACE=\"Verdana\">$error</FONT></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER><FONT SIZE=\"-2\" FACE=\"Verdana\"><A HREF=\"http://www.phpscriptcenter.com/uploader.php3\" TARGET=\"_blank\">Uploader</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\"http://www.phpscriptcenter.com/\" TARGET=\"_blank\">PHPScriptCENTER.com</A></FONT></CENTER>
</BODY>
</HTML>");
exit();
} else {
$num = 0;
while($num < $ADMIN[UploadNum]) {
$num++;
$html .= "<TR>
<TD WIDTH=\"25%\" BGCOLOR=".$tcolor.">
<FONT COLOR=\"#ffffff\" SIZE=\"-1\" FACE=\"Verdana\">File $num:</FONT></TD>
<TD WIDTH=\"75%\" BGCOLOR=".$bgcolor.">
<INPUT NAME=\"fileup$num\" TYPE=\"file\" SIZE=\"25\">
</TD> ";
}
if($ADMIN[RequirePass] == "Yes") {
$passhtml = "<P><CENTER><TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">
<TR>
<TD WIDTH=\"100%\" BGCOLOR=".$bgcolor.">
<TABLE WIDTH=\"300\" BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"2\">
<TR>
<TD WIDTH=\"33%\" BGCOLOR=".$tcolor.">
<B><FONT COLOR=".$fcolor." SIZE=\"-1\" FACE=\"Verdana\">Password:</FONT></B></TD>
<TD WIDTH=\"67%\" BGCOLOR=".$bgcolor2.">
<INPUT NAME=\"password\" TYPE=\"password\" SIZE=\"25\">
</TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></CENTER></P>";
}
echo("<FORM ENCTYPE=\"multipart/form-data\" ACTION=\"uploader.php3\" METHOD=\"POST\">
<P><CENTER><B><FONT FACE=\"Verdana\">Upload</FONT></B></CENTER></P>
<P><CENTER><TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\">
<TR>
<TD WIDTH=\"100%\" BGCOLOR=".$bgcolor.">
<TABLE WIDTH=\"450\" BORDER=\"0\" CELLSPACING=\"1\" CELLPADDING=\"2\">
<TR>
<TD COLSPAN=\"2\" BGCOLOR=".$tcolor2.">
<B><FONT COLOR=".$fcolor." SIZE=\"-1\" FACE=\"Verdana\">Wähle Dateien</FONT></B></TD>
</TR>$html
</TABLE></TD>
</TR>
</TABLE></CENTER></P>$passhtml<P><CENTER><INPUT NAME=\"doupload\" TYPE=\"submit\" VALUE=\"Hochladen\"></CENTER></FORM>
<P><CENTER> </CENTER></P>
<P><CENTER> </CENTER></P>
<P><CENTER><FONT SIZE=\"-2\" FACE=\"Verdana\"><A HREF=\"http://www.ectona.com\" TARGET=\"_blank\">Uploader</A> Version 1.0 <BR>
Copyright © 2000-2001 <A HREF=\"http://www.phpscriptcenter.com/\" TARGET=\"_blank\">PHPScriptCENTER.com</A></FONT></CENTER>
</BODY>
</HTML>");
exit();
}
php?>
Kommentar