I use this pre-population stuff a lot for editing account info. It's real simple for drop down menus. But the concept you had going is what you'll have to do since you're not pulling your OPTION values from a database. Unfortunately it'll take longer because you have to run an IF statement for each value without the help of a loop :/ but it'll have the same effect :-)
<SELECT BLAH BLAH>
<?php
if($array[dropdown] == "value1")
echo("<OPTION SELECTED value="value1">Value 1\n");
else
echo("<OPTION value="value1">Value 1\n");
if($array[dropdown] == "value2")
echo("<OPTION SELECTED value="value2">Value 2\n");
else
echo("<OPTION value="value2">Value 2\n");
if($array[dropdown] == "value3")
echo("<OPTION SELECTED value="value3">Value 3\n");
else
echo("<OPTION value="value3">Value 3\n");
// and so on for each value...
?>
</SELECT>
You could alternatively store all the values in a separate text file and call the option values from that; however with the time it would take to set that up you'd already have this done.
I really recommend MySQL though :-) Not for this project, since you said other external scripts or applications are dependant on the text file. But, for other project MySQL is probably the way to go--you'll love it :-)
Here's an example of the script above using MySQL:
<SELECT BLAH BLAH>
<?php
$query = "SELECT * FROM optionvalues";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
if($array[dropdown] == $row[value])
echo("<OPTION SELECTED value=\"".$row[value]."\">".$row[value]."\n");
else
echo("<OPTION value=\"".$row[value]."\">".$row[value]."\n");
}
?>
</SELECT>