choose selected for select option with condition [closed]

You should have only 1 select. Before the “>” of each option you can add

<?php echo ( $_POST['select1'] == 'value' ? 'selected' : '' ); ?>