I have a file input selection as follows in a form which I send data from using the POST Method.
<input type="file" name="inputFile">
I would like to validate that the user has chosen a file and would like to check whether the file is an image file (png,jpg)
I am also getting stuck because a line in my code is generating an error. Why?
'Array key 'inputFile' is undefined'
if (isset($_POST['submit'])) {
$file = $_FILES['inputFile']; //THIS LINE IS GENERATING AN ERROR
}