Need help with checking if picture was uploaded to var imagefile or not.
Here is the form to upload image:
<form enctype="multipart/form-data" action="Insertion_Request.php" method="post">
.....input text
.....input text
....input text
and last field is for image......
<input type=hidden name=MAX_FILE_SIZE value=150000>
<input type=hidden name=completed value=1>
<input type=file name=imagefile >
<input name="submit" type=submit value='Submit Form'>
Then in page Insertion_Request.php checks if imagefile has data and if so loads it to Mysql table.
As you can see Author of this code sets variable completed to 1 and then checks in Insertion_Request.php if completed = 1 which suppose to mean that image was uploaded to var imagefile:
if if ($_REQUEST[completed] == 1) { Insert imagefile to Mysql......}
However var completed is always set to 1 when form is submitted, no matter if image was selected or not.
I have tried to check if imagefile has data like this:
$Picture=$_POST['imagefile'];
if (!$Picture) { then ...}
but it does not work.
So how can I check if user added image or submitted form without selecting image?