How to apply formula on posted array values?

Page1:

PHP Code:

echo”<table border=1>”;
    
echo”<form method=’post’ name=’data_form’ id=’form1′ action=’data_validate.php’>”;
for($i=1; $i<=2; $i++)
{
for($j=1; $j<=3; $j++)
{
    
 echo “<th> <input type=’text’ name=’x[]’ size=’1′> </th>”;
 
}
}
echo”</tr> </form> </table>”; 

Page2 (data_validate.php):

PHP Code:

$x = $_POST[’x’];
    
$counter=0;    
    
    
echo”<table border=1>”;
for($i=1; $i<=2; $i++)
{
for($j=1; $j<=3; $j++)
{
 
    
$result=( ($x[$counter])  / (???????????) );
    
echo”<th>”.$result.”</th>”;
    
++$counter;
 
}
}
echo”</tr> </table>”; 

I posted the values of […]

Original post by faststart

Leave a Reply