hola tengo el siguiente codigo:
<?php
$producto=$_POST['cotizar'];
$valores=$_POST['valores'];
//$suma=$_POST['suma'];
 
$cont=count($_POST['cotizar']);
 
$i=0;
$suma=0;
 
?>
 
 
<body>
<p><img src="header-fondo-izq.png" width="1663" height="75" /></p>
<div align="right"></div>
<table width="200" border="1">
   <tr>
    <td>nombre</td>
    <td>precio_venta</td>
  </tr>
  <?php
  while($i<$cont)
	{ 
 
 ?>
	<tr>
    <td><form id="form2" name="form2" method="post" action="">
      <?php echo $valores[$i]?>
    </form></td>
 
    <td><form id="form3" name="form3" method="post" action="">
      <?php echo $producto[$i]?>
    </form></td>
 
</tr>
 
  <?php
 
	$i++;
	}
 
  ?>
  <tr><td></td>
 <td><form id="form4" name="form4" method="post" action="">
   <?php for($i=0;$i<count($_POST['cotizar']);$i++) 
{  
      if(isset($_POST['cotizar'][$i])!=''){ 
          $suma = $suma + $_POST['cotizar'][$i]; 
      } 
} 
echo $suma; ?>
 </form></td></tr>
</table>
<p> </p>
<form id="form1" name="form1" method="post" action="gastos.php?variable=<?php echo $suma?>">
  <input type="submit" name="button" id="button" value="Enviar por correo electrónico" />
</form>
<p> </p>
</body>
</html>
 
No he podido ingresar las variables en la base de datos ya que tengo mi tabla con los campos de nombre precio de venta y total pero no he podido insertarlos 
   
 



