If you are not using a database, try the following.
Make sure your form is using the POST method , if not change $_POST to $_GET.
$color_arr = array('Red'=>'RED',
'Yellow'=>'YEL',
'Green'=>'GRN',
'Blue'=>'BLU',
'White'=>'WHT',
'Black'=>'BLK',
'Brown'=>'BRN');
?>
<select name="color">
<?PHP
foreach($color_arr as $k => $v)
( $_POST['color'] == $v ) ? print( '<option value='.$v.' selected>'.$k.'</option>' ) : print( '<option value='.$v.'>'.$k.'</option>' );
?>
</select>
<input type="submit" value="submit">
|