I've spent all day on this and I fear I don't know enough about how file uploads work to fix this.
All I'm trying to do is detect wether a file has been uploaded or not in a form that sends info to a PHP page.
if file uploaded, it uploads it onto the server and enters the value in the db. So far - no problem.
HOWEVER, when I leave the file field blank and click on Submit, I keep getting an error:
"Warning: Unable to open 'none' for reading:" - I have placed an if statement to check for this but it get's ignored:
if ($_FILES['photo_1'] != "")
{
copy($FILES['photo_1']['tmp_name'], "/home/photos/".$FILES['photo_1']['name']);
}
else { echo "no photo to upload";}
This should work - but it doesn't!! can anyone advise???
F.