Many thanks for the help. The reason I didn't use the superglobal is because our php version is still 4.0 and so it's not going to work with just $_POST[' ']. However, I do have another question relating to this thread.
Now that it is working, is there a way to capture the selected option to a variable and display that option on the page? Below is the code I have:
$self = $HTTP_SERVER_VARS['PHP_SELF'];
echo '<form name="frmScholarship" method="post" action="'.$self.'">';
echo '<select name="sltScholarship" id="sltScholarship" onChange="frmScholarship.submit()">';
while ($row_rsScholarshipType = mysql_fetch_assoc($rsScholarshipType)){
$rows = mysql_num_rows($rsScholarshipType);
if($rows > 0) {
echo '<option value="'.$row_rsScholarshipType['sectionID'].'"';
if (isset($HTTP_POST_VARS['sltScholarship']) && $HTTP_POST_VARS['sltScholarship'] == $row_rsScholarshipType['sectionID']) {echo "SELECTED";}
echo '>';
echo $row_rsScholarshipType['category'];
echo '</option>';
}
}
echo '</select></form><p></p>';
The code above works just fine as you has helped me, but I also want to display the selected option on the page and bold it. Is there a way determine which option is selected and store that to a variable and display it later on the page?
Thank you,
ljCharlie