I can't show you exactly, but your code will look similar based on what your variables are named, etc... but this is similar to how it should be:
$oldValue = $_POST['oldvalue'] // assuming this is the old value
print '<select name="values">';
for ($i=1; $i<=10; $i++) {
if ($i == $oldValue) {
print '<option selected value="$oldValue">$oldValue</option>';
}
else {
print '<option value="$oldValue">$oldValue</option>';
}
}
print '</select>';
Basically, before you write each option for the dropdown, decide if it is the selected one, and write selected if so.
Psikic