Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- for loops with select option


nanat - 5:23 am on Oct 6, 2009 (gmt 0)


hi guys i try to figure out this for 3 days and i don't get it so give up.. if syntoms persist post a thread or find and expert.. :D

assuming i have select statement inside the function name selectProduction():

<select name="packTy">

this my for loops

<?php
<form method="POST" action="SaveProduction.php">
$row = 3;
$col = 6;
for ($r=1; $r<=$row; $r++)
{
echo '<table>';
echo '<tr>';
?>
<td width="285" id="info" NOWRAP="NOWRAP">
<table>
<tr>

</select></td>
<td width="44" height="30" valign="top">
<?php echo selectProduction();?>
<input type="hidden" size="6" name="value[]" value="<?=$r?>">
</td>

</tr>

</table>
</td>
<?

for ($c=1; $c <=$col; $c++)
{
echo'<td><input type="text" size="6" name="col[]"></td>';
}
echo '</tr>';
echo '</table>';
}
</form>
<tr>
<td><input type="submit" name="SQuery" value="Submit" /></td>
</tr>
?>


MY question is how can i get the <select name="packTy"> base in the 3 rows?

and post it TO my database..

if(isset($_POST["SQuery"]))
{
$value = count($_POST["value"]);

for($i=0; $i<$value; $i++)
{
$PackTye = $_POST["packTy"][$i];
echo ''.$PackTye.';
}
}

[edited by: dreamcatcher at 6:13 am (utc) on Oct. 6, 2009]
[edit reason] Fixed page view. [/edit]


Thread source:: http://www.webmasterworld.com/php/4001916.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com