In my php page, I have a form as:
<form enctype = 'multipart/form-data' method="post">
Select File:
<br/>
<input type="file" name="file" />
<input type="submit" name="upload" value="Upload" />
</form>
When I submit the form on clicking the submit 'upload', the following php is called which is on the same php page:
<?php
if (isset($_POST['upload'])) { ...Do stuff... }
?>
Now, I dont want to use the submit in my html form and want to trigger this php whenever a file in the input type file is selected. i.e. the form should be submitted automatically on file selection without the submit button. Also, i want a if condition such as isset($_POST['']) and dont want to use just a post check as $_SERVER['REQUEST_METHOD'] == 'POST'
Any help will be appreciated.