mohammedsk
11-30-2005, 07:48 AM
I need help in storing form elements in PHp array and then be able to read it. Arrays are something new to me.
for ($i=0; $i < $num_rows; $i++){
echo "<form action=returns1.php method=POST>";
echo "<input type='checkbox' name=\"mark[]\" value=\"$pid\">";
echo "<input type=text name='rqty[]' size=3>";
echo "<select name='status[]'><option value='Yes'>Yes</option><option value='No'>No</option>";
I am trying to pass tha values to the next page when I click on submit. The problem is that the form elements have varaible number depending on the number rows fetched from the table.
I found that code online and I looked in the PHP documentation, but still I do not get it
$marks = $_POST['mark'];
for($c = 0; $c < sizeof($mark); $c++) {
echo "$mark";
}
If anyone knows who to store the form elements in the array and display them
would be great?
Thanks in advance for any help.
for ($i=0; $i < $num_rows; $i++){
echo "<form action=returns1.php method=POST>";
echo "<input type='checkbox' name=\"mark[]\" value=\"$pid\">";
echo "<input type=text name='rqty[]' size=3>";
echo "<select name='status[]'><option value='Yes'>Yes</option><option value='No'>No</option>";
I am trying to pass tha values to the next page when I click on submit. The problem is that the form elements have varaible number depending on the number rows fetched from the table.
I found that code online and I looked in the PHP documentation, but still I do not get it
$marks = $_POST['mark'];
for($c = 0; $c < sizeof($mark); $c++) {
echo "$mark";
}
If anyone knows who to store the form elements in the array and display them
would be great?
Thanks in advance for any help.