See: http://www.ipixels.co.uk/swift_pumps/phpbuilder.php
How can I feed the variable created by the drop down back into the <option selected> tag so that after the page refreshes back to itself your choice is still showing in the drop down?
<?php
session_start();
session_register($row["chem_description"]);
$Host = "xxxxx";
$User = "xxxxxx";
$Password = "xxxxx";
$DBName = "xxxxxx";
$TableName = "chemicals";
$Link = mysql_connect($Host, $User, $Password) or die(mysql_error());
?>
<HTML>
<HEAD>
</HEAD>
<BODY>
<FORM NAME="frmPump" METHOD="post" ACTION="phpbuilder.php">
<TABLE WIDTH="592" HEIGHT="44" BORDER="2" CELLPADDING="8" CELLSPACING="0" BORDERCOLOR="#FFFFFF" BGCOLOR="#CCCCCC">
<TR>
<TD WIDTH="127" HEIGHT="40" CLASS="copy">1</TD>
<TD ALIGN="center"> <SELECT NAME="chemical" SIZE="1" ID="chemical" ONCHANGE="javascript:frmPump.submit()">
<OPTION SELECTED><?php echo $row["chem_description"] ?></OPTION>
<?php
$qry1 = "SELECT chem_description FROM $TableName";
$res1 = mysql_db_query($DBName,$qry1,$Link);
for ($i=0; $i <mysql_num_rows($res1); $i++) {
$row = mysql_fetch_array($res1);
printf("<option value=\"%s\">
%s
</OPTION>
",$row["chem_description"],$row["chem_description"]); } mysql_free_result($res1);
?>
</SELECT>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>