That depends on how the dropdown list is generated. If it's from an array in php, this will be very easy. Just compare $_GET['package'] to the current value of the <option> being printed. If it matches, add a 'selected="selected"' option inside of the tag. If it's not the same, display it like normal.
Some code I
just finished writing the other day:
PHP Code:
<select name="department">
<?php
foreach($departments as $key=>$myrow) {
echo ($myrow['id'] == $row['dep']) ? '<option value="'.$myrow['id'].'" selected="selected">'.$myrow['name'].'</option>' : '<option value="'.$myrow['id'].'">'.$myrow['name'].'</option>';
}
?>
</select>
More simplistically:
PHP Code:
<select name="department">
<?php
foreach($departments as $key=>$myrow) {
if($myrow['id'] == $row['dep']) {
echo '<option value="'.$myrow['id'].'" selected="selected">'.$myrow['name'].'</option>';
} else {
echo '<option value="'.$myrow['id'].'">'.$myrow['name'].'</option>';
}
}
?>
</select>