I want to run a particular block of PHP if the user submits a form. It works if I use a submit button with name="submit" and:
<?php
if(isset($_POST['submit'])) {
code to run
}
?>
I don't know anything about javascript, and I want the code to run if the user changes a dropdown menu. If I make the first line of the dropdown
<select name="dropdownname" onchange="this.form.submit()">
the form appears (I haven't tested it) to submit if the user changes the dropdown choice. However, if I do this, the if(isset($_POST['submit'])) PHP code doesn't run. Is there a PHP if statement I can write that will respond to the form being submitted even though it's being submitted by a change in the dropdown and not a submit button?