how to pass another variable when using a form with post?
Posted: Fri Jan 21, 2005 11:12 am
I've got a table that contains a few form items. Each one of the items has a radio button to select an attribute. What I'm trying to do is pass another variable to the page after it refreshes. Here's the code for my radio button selection (Thanks to feyd for helping get this runing):
Now I know that I can access each item's value of add or drop with But how do I send another viariable along with the selection? When this page is created the items are pulled from a table that represents a category. I want to send the name of the category to the review.php page along with the form's post data. I've got the variable ready, I just can;t figure out how to do it.
Ideas?
Paul
Code: Select all
echo "<h3 ALIGN=CENTER>To Add or Drop from $name category</h3>\n";
echo "<TABLE ALIGN=CENTER CELLPADDING=5 NAME="$name" border=1 >\n";
echo "<FORM ALIGN=CENTER ACTION="review.php" METHOD=POST>\n";
$counter = 0;
foreach ($items AS $item)
{
$item = trim($item); //Remove newline char from item before using it
$item_listї] = $item; //Add to item_list array
echo "<tr><td>" . $item_listї$counter] . "</td>\n";
echo "<td><INPUT TYPE=RADIO NAME="" . $item_listї$counter] . "" VALUE="add" CHECKED >Add</td>\n";
echo "<td><INPUT TYPE=RADIO NAME="" . $item_listї$counter] . "" VALUE="drop" >Drop</td>\n";
echo "</tr>\n";
$counter++;check_for_submitted();
}
echo "<tr><TD COLUMNSPAN=3><INPUT TYPE="submit" NAME="submit" VALUE="Submit"></TD></TR>\n";
echo "</FORM>\n";
echo "</TABLE>\n";
echo "<br />";Code: Select all
$_POSTї$item_list]ї0, 1, 2...]Ideas?
Paul