I'm trying already for two hours to understand what am I doing wrong and I can't figure it out:
My HTML code:
<form action="php/images.php" method="post" enctype="multipart/form-data">
<input type="file" name="image" value="on" id="file">
<input type="submit" name="submit" value="Submit">
</form>
My PHP:
if ( isset($_POST['image'])
&& $_POST['image']=="on")
{
imageUpload();
}
When I removed the if
in the PHP file and immediately entered the inner function imageUpload()
I've been able to upload the image, why is the variable name
I pass using post
isn't working?!