Código PHP:
la BDVer original
<?php $textfield = $_POST['textfield']; $textfield2 = $_POST['textfield2']; $textfield3 = $_POST['textfield3']; $textfield4 = $_POST['textfield4']; $textfield5 = $_POST['textfield5']; $textfield6 = $_POST['textfield6']; $textfield7 = $_POST['textfield7']; $textfield8 = $_POST['textfield8']; $textfield9 = $_POST['textfield9']; $textfield10 = $_POST['textfield10']; $valor1 = row['valor1']; $valor2 = row['valor2']; $valor3 = row['valor3']; $valor4 = row['valor4']; $valor5 = row['valor5']; $valor6 = row['valor6']; $valor7 = row['valor7']; $valor8 = row['valor8']; $valor9 = row['valor9']; $valor10 = row['valor10']; } ?> <div align="center"> <form name="form1" method="post" action=""> <table width="691" border="1" cellspacing="0" cellpadding="0"> <tr> <td colspan="10"><div align="center"><strong>Valores Anteriores</strong></div></td> </tr> <tr> <td bgcolor="#99CC99">valor 1</td> <td bgcolor="#99CC99">valor 2</td> <td bgcolor="#99CC99">valor 3</td> <td bgcolor="#99CC99">valor 4</td> <td bgcolor="#99CC99">valor 5</td> <td bgcolor="#99CC99">valor 6</td> <td bgcolor="#99CC99">valor 7</td> <td bgcolor="#99CC99">valor 8</td> <td bgcolor="#99CC99">valor 9</td> <td bgcolor="#99CC99">valor 10</td> </tr> <tr> </tr> <tr> <td colspan="10"><div align="center"><strong>Valores a introducir (todos suman)</strong></div></td> </tr> <tr> <td bgcolor="#CCFF66">valor 1</td> <td bgcolor="#CCFF66">valor 2</td> <td bgcolor="#CCFF66">valor 3</td> <td bgcolor="#CCFF66">valor 4</td> <td bgcolor="#CCFF66">valor 5</td> <td bgcolor="#CCFF66">valor 6</td> <td bgcolor="#CCFF66">valor 7</td> <td bgcolor="#CCFF66">valor 8</td> <td bgcolor="#CCFF66">valor 9</td> <td bgcolor="#CCFF66">valor 10</td> </tr> <tr> <td><label> <input name="textfield" type="text" id="textfield" value="<?php echo $textfield; ?>" size="5"> </label></td> <td><input name="textfield2" type="text" id="textfield2" value="<?php echo $textfield2; ?>" size="5"></td> <td><input name="textfield3" type="text" id="textfield3" value="<?php echo $textfield3; ?>" size="5"></td> <td><input name="textfield4" type="text" id="textfield4" value="<?php echo $textfield4; ?>" size="5"></td> <td><input name="textfield5" type="text" id="textfield5" value="<?php echo $textfield5; ?>" size="5"></td> <td><input name="textfield6" type="text" id="textfield6" value="<?php echo $textfield6; ?>" size="5"></td> <td><input name="textfield7" type="text" id="textfield7" value="<?php echo $textfield7; ?>" size="5"></td> <td><input name="textfield8" type="text" id="textfield8" value="<?php echo $textfield8; ?>" size="5"></td> <td><input name="textfield9" type="text" id="textfield9" value="<?php echo $textfield9; ?>" size="5"></td> <td><input name="textfield10" type="text" id="textfield10" value="<?php echo $textfield10; ?>" size="5"></td> </tr> <tr> <td colspan="10"><div align="center"><strong>Valores Resultantes de la Operacion Actual</strong></div></td> </tr> <tr> <td bgcolor="#9933CC">valor 1</td> <td bgcolor="#9933CC">valor 2</td> <td bgcolor="#9933CC">valor 3</td> <td bgcolor="#9933CC">valor 4</td> <td bgcolor="#9933CC">valor 5</td> <td bgcolor="#9933CC">valor 6</td> <td bgcolor="#9933CC">valor 7</td> <td bgcolor="#9933CC">valor 8</td> <td bgcolor="#9933CC">valor 9</td> <td bgcolor="#9933CC">valor 10</td> </tr> <tr> </tr> <tr> <td height="21" colspan="10"><div align="center"><strong>Botones de Accion</strong></div></td> </tr> <tr> <td height="64"> </td> <td> </td> <td> </td> <td> </td> <td colspan="2"><label> <div align="center"> <input type="submit" name="enviar" id="enviar" value="Calcular"> </label> <label> </div> <div align="center"></div> </label></td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> </div>
Código HTML:
-- phpMyAdmin SQL Dump -- version 3.2.0.1 -- http://www.phpmyadmin.net -- -- Servidor: localhost -- Tiempo de generación: 28-04-2010 a las 20:50:27 -- Versión del servidor: 5.1.36 -- Versión de PHP: 5.3.0 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Base de datos: `calculo` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `valores` -- CREATE TABLE IF NOT EXISTS `valores` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `valor1` int(3) NOT NULL, `valor2` int(3) NOT NULL, `valor3` int(3) NOT NULL, `valor4` int(3) NOT NULL, `valor5` int(3) NOT NULL, `valor6` int(3) NOT NULL, `valor7` int(3) NOT NULL, `valor8` int(3) NOT NULL, `valor9` int(3) NOT NULL, `valor10` int(3) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Volcar la base de datos para la tabla `valores` -- INSERT INTO `valores` (`id`, `valor1`, `valor2`, `valor3`, `valor4`, `valor5`, `valor6`, `valor7`, `valor8`, `valor9`, `valor10`) VALUES (1, 3, 4, 9, 8, 6, 7, 3, 5, 4, 9); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `visita` -- CREATE TABLE IF NOT EXISTS `visita` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `numero` int(2) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -- Volcar la base de datos para la tabla `visita` --