Saturday, 31 August 2013

How to validate if a file was sent in a form?

How to validate if a file was sent in a form?

I have this PHP code, but it doesn't validate whether the image was
uploaded or not, so if there's no image sent in the form it should stop
the process.
How can I change this code to make it work?
if(empty($_FILES['txtImage'])) {
$msg .= "Opss, you forgot the image.<br>";
}

No comments:

Post a Comment