Ver Mensaje Individual
Antiguo 15/04/2005, 20:40   #4
Coke
Invitado
 
Mensajes: n/a

prueba con este...

guardar.php

Código PHP:
<?
if (!$_POST){
?>
<html>
<head><title>Guardar datos en la base</title></head>
<body>
<h3>Guardar datos en la base</h3>
<form method="post" name="form1" 
action="guardar.php">
<p>Nombre:
<input type="text" name="nombre">
</p>
<p>Apellido:
<input type="text" name="apellido">
</p>
<p>DNI:
<input type="text" name="dni">
</p>
<p>
<input type="submit" name="Submit" value="Guardar Datos">
</p>
</form>
</body>
</html>
<?
}
else {
include"conexion.php";
$result=mysql_query("INSERT INTO usuarios (id,nombre, apellido, dni);
VALUES ('',$nombre,$apellido,$dni) ",$conexion);
?>
<html>
<head></head>
<body>
<h3>Los datos han sido guardados</h3>
</body>
</html>
<?
include "cerrar_conexion.php";
}
?>
le he hecho unas cuantas modificaciones...pruebalo a ver si va bien yo no le he probado.

Coke.

Respuesta rápida a este mensaje
Responder Citando Subir