if ($text_upload != "") : copy($text_upload, "details/datei_$id.txt");
endif;
endif;
Wenn aslo das Feld Upload gefüllt ist (bild_upload != ""), dann soll der das temporäre Bild in den Ordner details speichern.
Klappt auch klasse, wenn ich wirklich ein Bild uploaden will.
Wenn ich aber nun das Feld freilasse, weil ich keine Datei uploaden will, bekomme ich immer folgende Fehlermeldung:
Warning: Unable to open 'none' for reading: No such file or directory in D:\ftp\meine_domain\formular.php
Woran kann das liegen, was mache ich falsch?
Tip 1: Mach noch ein trim() um die Variable, die Du auf == "" checkst.
Tip 2: Nimm @copy() statt copy(), dann wird die Fehlermeldung unterdrückt und alles wird gut. :)