I have a site where people registre and uploads a profile photo.
It works fine with this script:
$uploadfile = $uploadfoto . $id.".jpg";
move_uploaded_file($_FILES['upload']['tmp_name'], $uploadfile);
It uploads the photo with the name 2.jpg ex. if the id number is 2.
But I have a problem if people do not want a photo attached.
Then the <input name="upload" type="file"> is left empty, and when you see the profile afterwards it can't find the photo offcause.
I have a special photo for people without photo attached, but I can't get it to upload this photo if the input field is left empty.
So is it possible to upload/copy a photo onthe webserver with the name $id.jpg if the field is left empty. ?