Hallo liebe php'ler...
ich habe ein script für eine gaming seite. dort kann man seine tuniere eintragen nun habe ich noch einen bildupload eingefügt für die screenshots.
allerdings wird das bild nichtmal hochgeladen obwohl pfade und rechte stimmen.
entsprechende zeile in der add datei:
PHP-Code:
<input type="file" name="userfile" class="form" size="40" />
die "action" seite wo alles ausgewertet und übergeben wird:
PHP-Code:
<?php $action=$_REQUEST['action'];
$mid=$_REQUEST['mid'];
$clan=$_POST["clan"];
$clanshort=$_POST["clanshort"];
$clanfrom=$_POST["clanfrom"];
$clanurl=$_POST["clanurl"];
$clanlineup=$_POST["clanlineup"];
$xonx=$_POST["xonx"];
$category=$_POST["category"];
// EDITED BY LORD // START
$map1=$_POST["map1"];
$map2=$_POST["map2"];
// EDITED BY LORD // END
$squad=$_POST["squad"];
$squadlineup=$_POST["squadlineup"];
$squadscore=$_POST["squadscore"];
$clanscore=$_POST["clanscore"];
$report=$_POST["report"];
$mark=$_POST["mark"];
$replays=$_POST["replays"];
$screens=$_POST["screens"];
$hours=$_POST["hours"];
$minutes=$_POST["minutes"];
$day=$_POST["day"];
$month=$_POST["month"];
$year=$_POST["year"];
$clanfrom=str_replace("symbols/countrys/","",$clanfrom);
$clanfrom=str_replace(".gif","",$clanfrom);
$datum=mktime($hours,$minutes,0,$month,$day,$year);
// EDITED BY LORD // START
$maps12=array($map1,$map2);
$maps=serialize($maps12);
// EDITED BY LORD // END
//<<<-----bildupload
$img=="";
$filename=$_FILES['userfile']['name'];
$filetmpname=$_FILES['userfile']['tmp_name'];
$filetype=$_FILES['userfile']['type'];
$filesize=$_FILES['userfile']['size'];
if(!empty($filename)) { $upload=2;
$filex="error"; $error=1; $msg="Falsches Dateiformat!";
if($filetype=="image/pjpeg") { $error=0; }
if($filetype=="image/jpeg") { $error=0; }
if($filetype=="image/jpg") { $error=0; }
if($filetype=="image/gif") { $error=0; }
$size=getimagesize($filetmpname);
if($size[0]>=500) { $error++; $msg="Das Bild ist zu breit!"; }
if($size[1]>=500) { $error++; $msg="Das Bild ist zu hoch!"; }
if($filesize>=819200) { $error++; $msg="Das Bild ist größer als 800kb!"; }
if(empty($error)) {
if(move_uploaded_file($_FILES['userfile']['tmp_name'], "$uploaddir/tactics/$filename")) {
chmod("$uploaddir/tactics/$filename",0755);
$upload=4; } } }
else { $upload=0; }
////--->>>>>
if($action=="add") {
$error=0;
if ($replays=="www.") { $replays=""; }
if ($screens=="www.") { $screens=""; }
if ($clanurl=="www.") { $clanurl=""; }
if (empty($clan) or $category=="" or $squadscore=="" or $clanscore=="") { $error++; }
if ($error==0) {
print "Clanwar <strong>erfolgreich</strong> eingetragen.. [ <a href=\"index.php?show=admin\">weiter</a> ]";
$add="INSERT INTO matches (clan, clanshort, clanfrom, clanurl, clanlineup, xonx, category, maps, squad, squadlineup, squadscore, clanscore, report, mark, replays, screens, userid, date, img) VALUES ('$clan', '$clanshort', '$clanfrom', '$clanurl', '$clanlineup', '$xonx', '$category', '$maps', '$squad', '$squadlineup', '$squadscore', '$clanscore', '$report', '$mark', '$replays', '$screens', '$myid', '$datum', '$img')";
$sqlaction=mysql_query($add); } else {
print "<strong>Fehler:</strong> Bitte mindestens die Felder Gegner, Typ und Ergebnis eingeben."; } }
Dies ist nur ein ausschnitt mit den betreffenden sachen...
ich hoffe ihr könnt mir weiter helfen.
gruß steste123