porfavor necesito ayuda! no he podido insertar datos a mi base de datos, ya he revisado varias veces el código y no entiendo porque no logra insertar los datos :s les dejo el codigo para que puedan ayudarme:
<?php
require_once ("conexion1.php");
if (isset ($_POST [ ' NOMBRE ' ] ) && !empty ( $_POST[ ' NOMBRE ' ] ) &&
isset ( $_POST [ ' PW ' ] ) && !empty ( $_POST[ ' PW ' ] ) )
{
$conexion = mysql_connect($Host, $User,$Pass) or die ("problemas al conectar");
mysql_select_db($BD,$conexion) or die ("problemas al conectar la bd");
return $conexion;
mysql_query("INSERT INTO codigof (NOMBRE, PW) VALUES ( '$_POST[NOMBRE]','$_POST[PW]' )", $conexion);
echo "datos insertados";
}else{
echo "problemas al insertar datos";
}
?>
y el html
<html>
<body>
<form action="insert4.php" method="post" name="form">
<input type="text" name="NOMBRE"/><br><br>
<input type="password" name="PW"/><br><br>
<input type="submit" name="button" id="button" value="Enviar" />
</form>
</body>
</html>