I had the same problem - also make sure you add name=""
in the input button. Well, that fix worked for me.
if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST['add'])){
echo "stuff is happening now";
}
<input type="submit" name="add" value="Submit">