1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
|
<?php
$pfad = "***"; # absoluter Pfad zum Uploadordner / Chmod 7-7-7
$upmail = "1"; # eMail nach Upload ja = 1 / nein = 0
$email = "***"; # wenn eMail nach Upload ja, dann eMail an die Adresse
$dateien = "1"; # Anzahl der Uploadfelder
$b_min = "10"; # minimale Bytes
$b_max = "524288"; # maximale Bytes / 1024 Bytes = 1 KB / 1024 KB = 1 MB
$pw = "1234"; # Passwort
$upw = "0"; # Passwort ja = 1 / nein = 0
$inhalt = "0"; # bei SAFE MODE Problem 1 eingeben
$mb = $b_max/1048576;
$mb = round($mb, 2);
if($upw=="1"){
if(isset($_POST['sendfiles'])){
if($_POST['pwd'] != $pw){
include("header.php");
echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">
<tr><td align=\"center\">
<span class=\"grossschrift\">
<b>Dateien hochladen</b>
</span>
</td></tr>
<tr><td width=\"100%\" align=\"center\">
<span class=\"grossschrift\">
<br>
Das Passwort fehlt oder ist falsch!<br>
<br>
<a href=\"javascript:history.back(1)\" class=\"kleinlink\">« zurück</a>
<meta http-equiv=\"refresh\" content=\"5; URL=http://www.arne-home.de/index.html\">
<br><br>
</td></tr>
</table>";
include("footer.php");
exit;}
}
}
if($_GET['action'] == 'inhalt') {
include("header.php");
echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">
<tr><td align=\"center\">
<span class=\"grossschrift\"><b>Inhalt des Uploadordners</b></span>
</td></tr>
<tr><td width=\"100%\" align=\"center\"><br>";
$verz=opendir (''.$pfad.'/.');
while ($File = readdir ($verz)) {
if($File != '.' && $File != '..' && $File != '.htaccess') {
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"50%\"><tr><td><span class=\"grossschrift\"><li>$File</li></span></td></tr></table>";}
}
echo "<br><a href=\"javascript:history.back(-1)\" class=\"kleinlink\">« zurück</a><br><br><a href=\"http://www.arne-home.de\" class=\"kleinlink\" target=\"_blank\">Upload v1.0.2 © by Arne</a><br><br></td></tr></table>";
include("footer.php");
exit;
}
include("header.php");
?>
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td align="center">
<span class="grossschrift">
<b>Dateien hochladen</b>
</span>
</td></tr>
<tr><td width="100%" align="center">
<span class="grossschrift">
<br>
Die Datei darf nicht größer als <?php echo "$mb"; ?> MB sein.<br>
Wieviele Dateien sollen hochgeladen werden?<br>
<br>
<?php if($inhalt=="0"){ echo "<a href=\"index.php?action=inhalt\" class=\"grosslink\"><b>Inhalt des Uploadordners</b></a><br>";} ?>
<br>
</span>
<form action="<?echo $PHP_SELF ?>" method="post">
<select name="numfiles" class="select">
<?php
for ($i=1; $i<=$dateien; $i++) {
echo ("<option value=$i>$i");
}
?>
</select>
<input type="Submit" value="Anzahl festlegen" name="up" class="button">
<br><br>
</form>
<form enctype="multipart/form-data" method="post" action="<?echo $PHP_SELF ?>">
<?php
if(isset($_POST['up'])){
echo "<span class=\"grossschrift\"><b>$numfiles</b> ";
echo $numfiles == '1' ? 'Datei kann' : 'Dateien können';
echo ' hochgeladen werden.</span><p>';
for ($i=1; $i<=$numfiles; $i++){
echo "<input type=\"File\" name=\"myfile$i\" class=\"input\"><br>\n";}
if($upw=="1"){echo'<br><span class="grossschrift">Passwort</span> <input type="password" name="pwd" class="input">';}
echo '<br><br><input type="Submit" name="sendfiles" value="hochladen" class="button"><br><br><a href="http://www.arne-home.de" class="kleinlink" target="_blank">Upload v1.0.2 © by Arne</a>';}
if (isset($sendfiles)){
$numsendfiles = count($HTTP_POST_FILES);
foreach($HTTP_POST_FILES as $strFieldName => $arrPostFiles){
if ($arrPostFiles['size'] > $b_min && $arrPostFiles['size'] < $b_max){
$strFileName = $arrPostFiles['name'];
$strFileTemp = $arrPostFiles['tmp_name'];
@copy ($strFileTemp, "$pfad/$strFileName");
echo "<br><span class=\"grossschrift\"><font color=green><b>Datei <u>$strFileName</u> erfolgreich hochgeladen.</b></font></span><br>";
}
else{
echo "<br><span class=\"grossschrift\"><font color=red><b>Die Datei muß größer als $b_min Bytes und kleiner als $mb MB sein!</b></font></span><br>";}
}
if ($upmail == 1) {
$ip = $_SERVER["REMOTE_ADDR"];
$subject = "Upload auf Homepage";
$body .= "Datum: ".date("d.m.Y, H:i:s")." Uhr\n";
$body .= "IP: $ip";
@mail($email, $subject, $body, "From: $email");
}
}
?>
<br>
</form>
</td></tr>
</table>
<?php include("footer.php");?> |