Bueno te tratare de ayudar... lo que hice fue dividir la pagina en dos formularios...
el primero lo que hace es enviar los datos a esa misma pagina para que se haga la operacion, en el segundo lo que hice fue guardar en una variable escondida el valor del resultado... cuando en el segundo formulario se le da enviar pasa a una segunda pagina que hace la insercion... si todo va bien el insert debe funcionar... ya te toca a ti organizarla un poco para que quede bien
PAGINA1.php
Código PHP:
<?php
if (isset($_POST['submit'])){
$N1=$_POST['numero1'];
$N2=$_POST['numero2'];
$N3=$_POST['numero3'];
$result = (($N1 * $N2 * $N3) * 0.45);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<style type="text/css">
<!--
.Estilo3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }
-->
</style>
<style type="text/css">
<!--
.Estilo3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }
.Estilo6 {font-size: 12px}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="<? $_SERVER['PHP_SELF'] ?>">
<p> </p>
<script type="text/javascript">
<!--
function checkEmptyFields() {
document.depositForm.submit();
}
//-->
</script>
</p>
<p> </p>
<table width="508" border="1" align="left">
<tr>
<td height="31" colspan="3">
<div align="center"><span class="Estilo3">
<label>
Medidas
<label> </label>
</span></div></td>
<td width="80" rowspan="2"><label>
<div align="center">
<input type="submit" name="enviar" id="enviar" value="Calcular">
</div>
</label></td>
<td width="184" rowspan="2"><div align="center"><span class="Estilo3"><br />
Volumen Total.: <?php echo $result; ?> </span></div></td>
</tr>
<tr>
<td width="70" height="58"><span class="Estilo3">
<div align="center">Medida 1 <br />
<br />
<label>
<input name="numero1" type="text" id="numero1" size="10" />
</label>
</div>
</span></td>
<td width="70"><span class="Estilo3">
<div align="center">Medida 2 <br />
<br />
<label>
<input name="numero2" type="text" id="numero2" size="10" />
</label>
</div>
</span></td>
<td width="70"><span class="Estilo3">
<div align="center">Medida 3<br />
<br />
<label>
<input name="numero3" type="text" id="numero3" size="10" />
</label>
</div>
</span></td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</form>
<p>
<form id="form2" name="form1" method="post" action="pagina2.php">
<table width="245" border="1">
<tr>
<td width="51"><div align="left">Nombre</div></td>
<td width="178"><label>
<div align="left">
<input type="text" name="nombre" id="nombre" />
</div>
</label></td>
</tr>
<tr>
<td><div align="left">Resultado de calculo</div></td>
<td bgcolor="#FFFF00"><label>
<label></label>
</label>
<? echo $result ?>
<input type="hidden" name="resultado" value="<? echo $result ?>" />
<label></label></td>
</tr>
<tr>
<td colspan="2"><label>
<div align="center">
<input type="submit" name="enviar" id="enviar" value="Enviar" />
</div>
</label></td>
</tr>
</table></p>
</form>
</body>
</html>
PAGINA2.php
Código PHP:
<?php
$nombre=$_POST['nombre'];
$resultado=$_POST['resultado'];
//conectando a la BD
$usuario = "usuario";
$contrasena = "clave";
mysql_connect('localhost',$usuario,$contrasena) or die ("error conectando".mysql_error());
mysql_select_db("****_DB1") or die ("error seleccionando la base de datos".mysql_error());
$insersion = "INSERT INTO tabla (nombre,resultado) VALUES('$nombre','$resultado')";
mysql_query($insersion) or die ("error insertando en la base de datos".mysql_error());
?>
Si te saca error postealo aca... Suerte