MrTV
asked on
make a select , then pass data to next pa ge
How can I write php program to take data form row that customer select
The below is my code please look at
www.kohsamui.ca/computer/install.html
<?
for ($times=2;$times<=10;$time s++) {
$ProCost = 18000;
$paid = 3000;
$IntRate = 1.5;
$InsCost = $ProCost-$paid;
$interrest = $InsCost*$IntRate/100*$tim es;
$total = $interrest+$InsCost;
$monthPay = $total/$times;
// <td> </td>
?>
<tr align="right">
<td><?php echo number_format($ProCost,2); ?></td>
<td><?php echo number_format($paid,2); ?></td>
<td><?php echo number_format($IntRate,2); ?></td>
<td><?php echo $times; ?></td>
<td><?php echo number_format($InsCost,2); ?></td>
<td><?php echo number_format($interrest,2 ); ?></td>
<td><?php echo number_format($total,2); ?></td>
<td><?php echo number_format($monthPay,2) ; ?></td>
</tr>
<?php
}
?>
</table>
The below is my code please look at
www.kohsamui.ca/computer/install.html
<?
for ($times=2;$times<=10;$time
$ProCost = 18000;
$paid = 3000;
$IntRate = 1.5;
$InsCost = $ProCost-$paid;
$interrest = $InsCost*$IntRate/100*$tim
$total = $interrest+$InsCost;
$monthPay = $total/$times;
// <td> </td>
?>
<tr align="right">
<td><?php echo number_format($ProCost,2);
<td><?php echo number_format($paid,2); ?></td>
<td><?php echo number_format($IntRate,2);
<td><?php echo $times; ?></td>
<td><?php echo number_format($InsCost,2);
<td><?php echo number_format($interrest,2
<td><?php echo number_format($total,2); ?></td>
<td><?php echo number_format($monthPay,2)
</tr>
<?php
}
?>
</table>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just stick that stuff into a PHP file by itself and put it on your webserver and it should work fine. I tested it.
JP
JP
<tr align="right">
<td><?php echo number_format($ProCost,2);
// other values here.........
</tr>
Ref : http://www.kohsamui.ca/computer/install.html
Name the check boxes as I have done above, i.e generae dynamic name for check boxes.
<input type="checkbox" name="checkbox<?php echo $times?>" >
Once the user selects the options and submit, you can find the slected options from their name and select the values from the hidden boxes of the corresponding row set.
For example
if checkbox2 is checked select values from the procost2 , paid2 ...etc
if checkbox3 is checked select values from the procost3 , paid3 ...etc
Hope this helps.