nombre de la base = cursobd(tabla= cursotable)
codigos(todos en la misma carpeta):
registrodeusuarios.php:
Código
<html> <body> <form action="registro.php" method="post" name="form"> <table width="200" border="0"> <tr> <td>Nombre</td> <td><input type="text" name="nombre" /></td> </tr> <tr> <td>Apellido</td> <td><input type="text" name="apellido" /></td> </tr> <tr> <td>Password</td> <td><input type="password" name="pw" /></td> </tr> <tr> <td> </td> <td><input type="submit" value="Insertar datos" /></td> </tr> </table> </body> </html>
registro.php:
Código
<?php include("conexion.php"); { VALUES ('$_POST[nombre]','$_POST[apellido]','$_POST[pw]')",$conexion); echo"Datos insertados"; }else{ echo "problema al insertar datos"; } ?>
conexion.php:
Código
<?php $host = "localhost"; $user = "root"; $pw = "mipass"; $bd = "cursobd"; ?>