Perhaps because the if( $_POST['submit$i] ) is always checking $_POST[submit4]. You may want to put the submit button into a form control before expecting to have a $_POST in the first place. If you're generating all the 4 buttons in the same form, note that only one button will be available at a given point (e.g.: you can't set all the 4 post buttons to be available after posting the form).
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.