Skip to content

Commit a01ea55

Browse files
committed
keep filename in dropdown
1 parent 545ab9c commit a01ea55

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
}
1919
$files = glob("$dir/*.xt");
2020
foreach ($files as $file) {
21-
echo '<option value="' . htmlspecialchars($file) . '">' . htmlspecialchars(basename($file)) . '</option>';
21+
$checked = ($file == $_REQUEST['file']) ? 'selected="selected"' : '';
22+
echo '<option value="' . htmlspecialchars($file) . '" '.$checked.'>' . htmlspecialchars(basename($file)) . '</option>';
2223
}
2324
?>
2425
</select>

0 commit comments

Comments
 (0)