That code seems to work for me if I make $mode equal either 'paypal' or 'bank'. Is it not working on your end? You might want to check that $mode is outputting what you expect. You might want to make a function out of it to simplify things if you're going to do something like this a bunch of times:
PHP Code:
<?php
function selected($opt1,$opt2) {
if ($opt1 === $opt2) echo 'selected="selected"';
}
?>
<select name="mode" id="mode">
<option value="bank" <?php selected($mode,'bank');?> >bank</option>
<option value="paypal" <?php selected($mode,'paypal');?> >paypal</option>
</select>
Bookmarks