I think maybe I am having a mental block, can someone give me a boost, this should be easy, but have a lot of other things on my mind. I have this form that dynamically populates from a database, I want to use what they select as they global for the rest of the users pages, 3 pages on average. Should I be using sessions or can I just use it as a global. Here is the form. it seems to post to the next page but cannot get it to work. Thanks in advance.
<form action="selectgroup.php" name="form1" action="post">
<?
mysql_connect("");
mysql_select_db("");
$query1_result = mysql_query ("SELECT catagory FROM Dealers");
$num_results = mysql_num_rows($query1_result );
$catagories = array();
//use the for loop to populate the array with the unitnos from the query
for ($i=0; $i<$num_results; $i++)
{
$catagory_row=mysql_fetch_object($query1_result );
$catagories[]=$catagory_row->catagory;
}
//start the dropdown box
echo "<select name=\"catagory\" value=\"$catagory\" onChange=\"document.form1.submit();\">";
//detect if this script has been submited yet
if (!isset ($catagory))
{
$selected_catagory = "";
}
else
{
$selected_catagory = $catagory;
}
if ($selected_catagory == "")
{
echo "<option value=\"\" SELECTED>SELECT DEALER</option>";
}
else
{
echo "<option value=\"\" >SELECT DEALER</option>";
}
//populate the option and provide a SELECTED option for each item in the array
foreach ($catagories as $catagory)
{
if ($selected_catagory == $catagory)
{
echo "<option value=\"$catagory\" SELECTED >$catagory</option>";
}
else
{
echo "<option value=\"$catagory\" >$catagory</option>";
}
}
echo "</select>";
?>
</form>