So bin mit dem Uploadscript soweit fertig... jetzt hätte ich eine bitte: könntet ihr euch den Quelltext durchlesen? Hab daran oft was geändert, es funktioniert zwar alles aber vill. fällt euch ein fehler auf!!
Achja bitte nur den PHP Code! HTML hat noch einige Fehler, der rest kommt noch alles ins CSS.
PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<title>The Hoster</title>
<META name="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link href="css.css" rel="stylesheet" type="text/css" />
<?php
#$maxserversize = 1000000000;
// Erstellen der Zufallszahl ....
mt_srand((double)microtime()*10000000);
$zufallszahl = mt_rand(0,9999999);#Zufallszahl zwischen....
$thesize = 2000000; # Maximal Dateigröße
$sitename = "TheHoster"; # Titel der Seite
$serverpath = "http://blogstar.bl.ohost.de"; #Url unter der der Server erreichbar ist!
$dirname = "thehoster"; #Der name des Ordners in dem sich dieses Script befindet!
$filedir = "web"; #Name des Ordners in dem sich die Upgeloadeten Datein befinen! Sollte nicht geändert werden!!
$filepath = "/$dirname/web/$zufallszahl$datei_name";
?>
<script type="text/javascript">
function checkCheckBox(f){
if (f.agree.checked == false )
{
alert('You have to agree with the Terms and Condtions to submit any media!');
return false;
}else
return true;
}
</script>
</head>
<body>
<table width="500" border="0" cellpadding="0" cellspacing="0" class="simple">
<tr>
<td>
[img]img/logo.png[/img]
</td>
</tr>
<tr>
<td class="kuk"></td>
</tr>
<tr class="table">
<td class="table">
<?php
if ($gsen==1)
{
if($datei_size>$thesize) {$fehler.="Sorry the File you want to upoad is too big!
You just can upload $thesize Bytes!";}
#Zugelassene Dateitypen
if(
/*($datei_type != 'text/html' && $datei)
&& ($datei_type != 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' && $datei)
&& ($datei_type != 'text/plain' && $datei)
&& ($datei_type != 'application/x-php' && $datei)
&& ($datei_type != 'application/pdf' && $datei)
&& ($datei_type != 'application/x-msdownload' && $datei)
&& ($datei_type != 'application/zip' && $datei)
&& ($datei_type != 'application/octet-stream' && $datei)*/
#Zugelassene Bildformate
($datei_type != 'image/pjpeg' && $datei)
&& ($datei_type != 'image/gif' && $datei)
&& ($datei_type != 'image/jpeg' && $datei)
&& ($datei_type != 'image/png' && $datei)
&& ($datei_type != 'image/x-png' && $datei)
&& ($datei_type != 'image/bmp' && $datei)
)
{$fehler.="Filetype not supoorted! " .$datei_type. "
" ;}
if(!$datei){$fehler.="Please choose a file!";}
if($fehler)
{
$meldung="<center><font family='Trebuchet MS' color='#880000'>" .$fehler. "</font></center>";
unset($gsen);
echo $meldung;
}
else
{
$writeurl = "";
if ($uvz2 != "")
{
$writeurl = "/".$uvz2;
}
$uvz = "$filedir$writeurl";
if (!file_exists($uvz))
{
mkdir($uvz,0755);
}
$name=$uvz."/".$zufallszahl.$datei_name;
copy($datei, $name);
$sizer = $datei_size;
$ending = "Byte";
if ($sizer > 1000)
{
$sizer = $sizer / 1000;
$sizer = number_format($sizer,2,",",".");
$ending = "KB";
}
echo '<center>';
echo "<font color='#0066ff' size='5px'>Information:</font>";
echo '
';
echo '<table class="info">';
echo '<tr>';
echo '<td>';
echo "<center>";
echo "</center>";
echo "<font color='#0066ff' size='3px'>Upload completed successfully!!</font>
";
echo "<font color='#0066ff' size='3px'>Filesize: $sizer $ending </font>
";
echo "<font color='#0066ff' size='5px'>[url='$filepath']Show file[/url]</font>";
echo '
';
echo '
';
echo "<font color='#0066ff' size='2px'>preview:</font>
";
echo "<a href='$filepath'>";
echo '<img src="';
echo $serverpath;
echo $filepath;
echo '" alt="';
echo $zufallszahl;
echo '"';
echo 'width="110px"';
echo 'height="110px"';
echo '/>';
echo '</a>';
echo '
';
echo "<font color='#0066ff' size='3px'>Image HTML Code</font>";
echo '
';
echo '<textarea name="htmlimg" cols="50" rows="4">';
echo '<img src="';
echo $serverpath;
echo $filepath;
echo '" alt="';
echo $zufallszahl;
echo '" />';
echo '</textarea>';
echo '
';
echo "<font color='#0066ff' size='3px'>Image BB code</font>";
echo '
';
echo '<textarea name="bbimg" cols="50" rows="4">';
echo '[img]';
echo $serverpath;
echo $filepath;
echo '[/img]';
echo '</textarea>';
echo '</td>';
echo '</tr>';
echo '</table>';
echo "
[url='$_SERVER[PHP_SELF]?$_SERVER[QUERY_STRING]'] <<< Zurück[/url]
";
echo '</center>';
}
}
if(!$gsen)
{
?>
<form action='<? echo $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']; ?>' method='post' enctype='multipart/form-data' name='form1' id='form1' onreset='return sicher()' onsubmit='return checkCheckBox(this)'>
<p class="Stil2"><input type="hidden" name="gsen" id="gsen" value=1/></p>
<p class="Stil2">1. Choose a file to submit:</p>
<p class="Stil2">
<input name="datei" type="file" id="datei" value='<? echo $datei; ?>' size="30" />
</p>
<p class="Stil2">2.Agree [url='terms.php']terms and conditions[/url]: </p>
<p class="Stil2">You have to agree with the [url='terms.php']terms and conditions[/url] to submit any content!! </p>
<p class="Stil2">
<input type="checkbox" value="0" name="agree" />I agree with the terms and conditions!</p>
<p class="Stil2"> 3. Press Upload to Submit your media
</p>
<p class="Stil2"> <input type="image" src="img/upload.jpg" alt="abschicken" /> </p>
<?php
if ($uvz2 == "")
{
}
}
$writeurl = "";
if ($uvz2)
{
$writeurl = "/".$uvz2;
echo "[url='$PHP_SELF']<< Home[/url]
";
}
?>
</form></td>
</tr>
<tr>
<td class="back">[img]img/bottom.png[/img]</td>
</tr>
</table>
</body>
</html>
Alles anzeigen
danke mfg lhg