Hallo,
Dateiupload funktioniert, Pfad Dateiname.ext wird in Datenbank geschrieben.
Jetzt möchte ich den Datensatz überarbeiten.
Hier funzt der Upload plötzlich nicht mehr.
Als Dateipfad wird der Pfad zur lokalen Datei ausgegeben:
E:\websites\startercentrum\images\partner\trsascha.jpg
Bin Einsteiger in PHP. Deshalb habe ich mal das Stück Code angehängt in dem ich den Fehler vermute.
Kann mir da jemand auf die Sprünge helfen?
// Bis hierhin funktioniert alles
...
WHERE id=$starterid";
};
$result = dbquery($conid, $sql);
print "<p align=center>$lang[addok]<br><a href=$PHP_SELF>$lang[editmore]</a></p>";
// Fotoupload
if ($foto != ''){
print "Pfad zur temporären Datei: $foto<br>Dateiname: $foto_name<br>Dateigröße: $foto_size<br>Dateityp: $foto_type";
// convert to canonic name
$t=explode(".",$foto_name);
$max=count($t)-1;
$ext=$t[$max];
$foto_name=str_replace(".$ext","",$foto_name);
$filename=eregi_replace("([^a-z0-9]*)","",$foto_name);
$filename=strtolower($filename);
// srand((double)microtime()*1000000);
// $filename=rand(10000,99999)."_".$filename.".$ext";
$filename=$filename.".$ext";
// Datei kopieren
if (function_exists("move_uploaded_file")){
move_uploaded_file($foto, $fotopath.$filename);
}else{
copy($foto, $fotopath.$filename);
unlink($foto);
}
$info=getimagesize($fotopath.$filename);
$result = dbquery($conid, "UPDATE $dbtable SET foto='$filename' WHERE (id='$starterid')");
};
// Ende Fotoaupload