Estoy intentando enviar desde un formulario unas variables a un fichero php para que haga un insert a mi base de datos, pero parece que las variables siempre llegan vacias, por que puede ser?
Código de envio de variables
Código:
<?xml version="1.0" encoding="utf-8" ?> <!--enconding utf-8 (Unicode)--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!--Le indica al navegador que estamos abriendo--> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es"> <!--Le indicamos que es un fichero xhtml y lenguaje español--> <head> <title>Addamio</title> </head> <body> <form method="post" action="php/CreateUser.php"> <div> <table> <tr> <td align="right">Usuario:</td> <td><input type="text" id="User" name="User" value="" /></td> </tr> <tr> <td align="right">Password:</td> <td><input type="text" id="Pass" name="Pass" value="" /> </td> </tr> <tr> <td align="right">Repetir Password:</td> <td><input type="text" id="RepPass" name="RepPass" value="" /> </td> </tr> <tr> <td align="right">Correo electronico:</td> <td><input type="text" id="Email" name="Email" value="" /> </td> </tr> <tr> <td></td> <td><input type="submit" name="enviar" value="Registrarse"></td> </tr> </table> </div> </form> </body> </html>
Php que recibe las variables
Código:
Algo sucede en en el fichero php porque jamas muestra el mensake de <?php
$User = $_POST["User"];
$Password = $_POST["Pass"];
$RepPass = $_POST["RepPass"];
$Email = $_POST["Email"];
$con = mysql_connect("localhost", "root", "");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$sql = "INSERT INTO userTable (UserId, Password, Email)
VALUES ('$User', '$Password', '$Email')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con);
?>
"1 record added"
Muchas gracias por la ayuda
y no te muestra algún error. 

