hello all
i am new to php ,
and i am trying to populate a form dynamically by textboxex and some labels ( texts)
once populated ,the user need to key in the values
once the values are keyed in its written to the database . one row at a time
the form
//----------------------------
<form name="createfrm" method="POST" action="<? PHP_SELF ?>" >
<table align="center" width="80%">
<tr>
<th class="pl" >Charges for</th>
<th class="pl" width="10%" >Whole Sale Call Price<br>(in cents)</th>
<th class="pl" width="10%" >Whole Sale Call Duration<br>(in secs)</th>
<th class="pl" width="10%" >Default Sale Call Price<br>(in cents)</th>
<th class="pl" width="10%" >Default Sale Call Duration<br>(in secs)</th>
</tr>
<?
while ($charge_row = mysql_fetch_array($charge_rs)){ ?>
<tr>
<td width="20%"><?echo $charge_row["charge_for"]?></td>
<td><input type="text" size="3" maxlength="3" name="<?echo "c[".$charge_row["id"]."][]"?>"></td>
<td><input type="text" size="5" maxlength="5" name="<?echo "c[".$charge_row["id"]."][]"?>"></td>
<td><input type="text" size="3" maxlength="3" name="<?echo "c[".$charge_row["id"]."][]"?>"></td>
<td><input type="text" size="5" maxlength="5" name="<?echo "c[".$charge_row["id"]."][]"?>"></td>
</tr>
<? } ?>
<tr></tr><tr></tr>
<tr>
<td width="15%" align="center" colspan="2"><input type="submit" name="create" Value="Create"></td>
<td width="15%" align="center" colspan="3"><input type="submit" name="cancel" Value="Cancel"></td>
</tr>
</table>
</form>
//--------------------------------
the php code to access the array c is
// -----------
if($_POST['create'])
{
$count = count($_POST['c']);
echo $count."<br>";
for($i=1;$i<=$count;$i++)
for($j=1;$j<=4;$j++)
echo "the values are :".$_POST[c]."<br>";
}
//---------------
the output is
// ------------
3
the values are :Array
the values are :Array
the values are :Array
the values are :Array
the values are :Array
the values are :Array
the values are :Array
the values are :Array
the values are :Array
the values are :Array
the values are :Array
the values are :Array
//----------
i want to get the values in each text box value entered by teh user so , i can capture it and write it to teh table ..
Thanks heaps!!