Les mostrare todo el codigo, que viene en 3 archivos
index.php
Código PHP:
Ver original<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
?>
</body>
</html>
ingresar.php
Código PHP:
Ver original<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Ingresar Datos</title>
</head>
<body>
<font face="Tw Cen MT" size="6">
<body style="background-attachment: fixed; background-repeat: no-repeat;"
background="background.jpg">
<center>
<img src="ingresar datos.png"><br><br><br>
<form action="ingresar.php">
Descripción: <input type="text" name="descripcion" size="10"><br>
Precio al Costo: <input name="preciocosto" type="text" size="10"><br>
Precio a la Venta: <input name="precioventa" type="text" size="10"><br>
Stock Anual: <input name="stockanual" type="text" size="10"><br>
Stock Minimo: <input name="stockminimo" type="text" size="10"><br><br>
<input type="submit" value="Guardar" name="action" style="width:90px; height:30px; color:#ffffff; background-image: url(boton.png); font-size: 20px; font-family: Tw Cen MT">
</form>
<?php
include("index.php");
$descripcion=$_GET{'descripcion'};
$preciocosto=$_GET{'preciocosto'};
$precioventa=$_GET{'precioventa'};
$stockanual=$_GET{'stockanual'};
$stockminimo=$_GET{'stockminimo'};
mysql_query("INSERT INTO articulos (descripcion,preciocosto,precioventa,stockanual,stockminimo) VALUES('$descripcion','$preciocosto','$precioventa','$stockanual','$stockminimo')");
?>
<a href="mostrar.php"><img src="mostrar datos.png" width="150" height="55" align="right"></a>
</center>
</font>
</body>
</html>
mostrar.php
Código PHP:
Ver original<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<font face="Tw Cen MT" size="6">
<body style="background-attachment: fixed; background-repeat: no-repeat;"
background="background.jpg">
<center>
<img src="mostrar datos.png"><br>
<br><br>
<?php
include("index.php");
echo "<TABLE BORDER='1'>";
echo "<tr>";
echo "<th>Código</th><th>Descripción</th><th>Precio al Costo</th><th>Precio a la Venta</th><th>Stock Anual</th><th>Stock Mínimo</th>";
echo "</tr>";
echo "<tr>";
echo "<td>",$r{'codigo'},"</td><td>",$r{'descripcion'},"</td><td>",$r{'preciocosto'},"</td><td>",$r{'precioventa'},"</td><td>",$r{'stockanual'},"</td><td>",$r{'stockminimo'},"</td>";
echo "</tr>";
}
echo"</TABLE>";
?>
<br><br><br><br><br>
<a href="ingresar.php"><img src="ingresar datos.png" width="150" height="55" align="right"></a>
</center>
</body>
</font>
</html>