Hi.
I'm new to this forum & to PHP. Just have a little problem. I want to pass the value of a select box to a php script on another page.
Here's the code:
[PHP] $output .= "<select name = \"field_select\ ">";
$result = mysql_query("SH OW COLUMNS FROM list");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows ($result) > 0) {
while ($row = mysql_fetch_ass oc($result)) {
$output .= "<option value = \"$row[Field]\">$row[Field]</option>";
echo($row[field]);
#print_r($row);
echo("<BR>");
}
}
$output .="</select>";
[/PHP]
and what I want on the output is the item actually SELECTED in the select box. What I'm actually getting is this:
FIELD NAME: Array=>Field
from the code:
[PHP]
############### ### SELECT BOX ASSIGNED TO VARIABLE $POTATO2
$potato2 = $_POST['field_select'];
echo("<B>FIELD NAME: </b>" . $potato2 ."<BR>");
[/PHP]
Can anyone help?
I'm new to this forum & to PHP. Just have a little problem. I want to pass the value of a select box to a php script on another page.
Here's the code:
[PHP] $output .= "<select name = \"field_select\ ">";
$result = mysql_query("SH OW COLUMNS FROM list");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows ($result) > 0) {
while ($row = mysql_fetch_ass oc($result)) {
$output .= "<option value = \"$row[Field]\">$row[Field]</option>";
echo($row[field]);
#print_r($row);
echo("<BR>");
}
}
$output .="</select>";
[/PHP]
and what I want on the output is the item actually SELECTED in the select box. What I'm actually getting is this:
FIELD NAME: Array=>Field
from the code:
[PHP]
############### ### SELECT BOX ASSIGNED TO VARIABLE $POTATO2
$potato2 = $_POST['field_select'];
echo("<B>FIELD NAME: </b>" . $potato2 ."<BR>");
[/PHP]
Can anyone help?
Comment