Help Pls...
i have this page let say its file name is orderlist.php, and i have drop down for each products in the order list.
php:
--------------------------------------------------------------------------------
<select size="1" name="reqmonth'.$row['o_mod_id']. '">
?>
--------------------------------------------------------------------------------
i believe that my concatenation of the name of the dropdown is ok.
but by clicking submit button, on the next page (submit.php)
how will i be able to get the value of the drop down from the previous page (orderlist.php)?
i tried this code
php:
--------------------------------------------------------------------------------
$reqMonth = $_POST["reqmonth$o_mod_id"];
?>
--------------------------------------------------------------------------------
but didnt work..
please help me.. thanks.
Getting Value
Moderator: General Moderators
$row['o_mod_id'] will evaluate to whatever value is in the array at that index. So, if $row['o_mod_id'] = 4, then your select name would be "reqmonth4". Uness you know what the value will be, the only way to get that post item will be to loop through the POST array. Try REALLY hard to set up your form so that the select has a static name - it'll make your life much easier when you're trying to retrieve that select's value.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
-
Cruzado_Mainfrm
- Forum Contributor
- Posts: 346
- Joined: Sun Jun 15, 2003 11:22 pm
- Location: Miami, FL
actually is not right at ALL
this:
<select size="1" name="reqmonth'.$row['o_mod_id']. '">
?>
should be this:
this:
<select size="1" name="reqmonth'.$row['o_mod_id']. '">
?>
should be this:
Code: Select all
<select size="1" name="reqmonth<?php echo $row['o_mod_id']; ?>">-
glennalmeda
- Forum Newbie
- Posts: 14
- Joined: Mon Jan 26, 2004 9:00 pm
let say this is my code now
assume:
now the name of the drop down is "reqmonth4" ryt?
but how can i retrieve the value on the next page?
is this correct? will i be able to get the value? ty
assume:
Code: Select all
$row['o_mod_id'] = 4
<select size="1" name="reqmonth<?php echo $row['o_mod_id']; ?>">but how can i retrieve the value on the next page?
Code: Select all
$o_mod_id = 4
$reqMonth = $_POST["reqmonth$o_mod_id"];