i am trying to get the data from my form using loop. The following code does not work
HTML code :-
<tr name="row_1" id="row_1">
<td align="center">1</td>
<td><input type="text" class="SText" contenteditable="true" value="Basic" name="SText_1" id="SText_1" /></td>
<td><input type="text" class="SAmount" contenteditable="true" value="6000.00" name="SAmount_1" id="SAmount_1" /></td>
</tr>
<tr name="row_2" id="row_2">
<td align="center">2</td>
<td><input type="text" class="SText" contenteditable="true" value="Housing" name="SText_2" id="SText_2" /></td>
<td><input type="text" class="SAmount" contenteditable="true" value="5000.00" name="SAmount_2" id="SAmount_2" /></td>
</tr>
PHP code :-
<?php
$i=1;
while ($i<=10) {
$sText_$i = $_POST['SText_$i'];
$sAmount_$i = $_POST['SAmount_$i'];
//$sText_$i = $_POST['SText_'] . $i ; // dont work either
//$sAmount_$i = $_POST['SAmount_'] .$i;
$i++;
}
?>