registros ala base de datos desde un formulario ph
Publicado por yoy (2 intervenciones) el 25/10/2008 05:06:31
tengo este formulario y mas abajo esta el fichero donde se procesa la informacion, al introducir datos no marca error pero no manda los registros a la base de datos alguien me podria decir donde esta el error?
<?
<html>
<head>
<title>Creacionde un portal con php y mysql</title>
</head>
<body bgcolor="#303030">
<body text="#E5E5E5">
<body leftmargin="50">
<body topmargin="50">
<font face="tahoma">
<font size="2">Formulario para registrarse en el portal de internet</font>
<hr size="9" color="ffffff" width="60%" align="left">
<form name="formregis" action="reg.php3" method="post">
Nombre:<input type="text" name="nombre" size="31">
<br><hr size="2" color="ffffff" width="30%" align="left">
Apellidos:<input type="text" name="apellidos" size="30">
<br><hr size="2" color="ffffff" width="30%" align="left">
Profesion:<input type="text" name="profesion" size="33">
<br><hr size="2" color="ffffff" width="30%" align="left">
Direccion:<input type="text" name="direccion" size="31">
<br><hr size="2" color="ffffff" width="30%" align="left">
Edad:<input type="text" name="edad" size="31">
<br><hr size="2" color="ffffff" width="30%" align="left">
<input name="Envia" type="submit" value="Enviar" size="30">
<hr size="9" color="ffffff" width="60%" align="left">
</form>
</body>
</html>
<html>
<body>
<?
$host="localhost";
$usuario="root";
$contraseña="contraseña";
$conectar=mysql_connect($host,$usuario,$contraseña);
mysql_select_db("empresa",$conectar);
$sql="INSERT INTO clientes(nombre,apellidos,profesion,direccion,edad)" + "VALUES('$nombre','$apellidos','$profesion','$direccion','$edad')";
$result=mysql_query($sql);
echo "¡Gracias! hemos recibido tus datos. ";
?>
</body>
</html>
<?
<html>
<head>
<title>Creacionde un portal con php y mysql</title>
</head>
<body bgcolor="#303030">
<body text="#E5E5E5">
<body leftmargin="50">
<body topmargin="50">
<font face="tahoma">
<font size="2">Formulario para registrarse en el portal de internet</font>
<hr size="9" color="ffffff" width="60%" align="left">
<form name="formregis" action="reg.php3" method="post">
Nombre:<input type="text" name="nombre" size="31">
<br><hr size="2" color="ffffff" width="30%" align="left">
Apellidos:<input type="text" name="apellidos" size="30">
<br><hr size="2" color="ffffff" width="30%" align="left">
Profesion:<input type="text" name="profesion" size="33">
<br><hr size="2" color="ffffff" width="30%" align="left">
Direccion:<input type="text" name="direccion" size="31">
<br><hr size="2" color="ffffff" width="30%" align="left">
Edad:<input type="text" name="edad" size="31">
<br><hr size="2" color="ffffff" width="30%" align="left">
<input name="Envia" type="submit" value="Enviar" size="30">
<hr size="9" color="ffffff" width="60%" align="left">
</form>
</body>
</html>
<html>
<body>
<?
$host="localhost";
$usuario="root";
$contraseña="contraseña";
$conectar=mysql_connect($host,$usuario,$contraseña);
mysql_select_db("empresa",$conectar);
$sql="INSERT INTO clientes(nombre,apellidos,profesion,direccion,edad)" + "VALUES('$nombre','$apellidos','$profesion','$direccion','$edad')";
$result=mysql_query($sql);
echo "¡Gracias! hemos recibido tus datos. ";
?>
</body>
</html>
Valora esta pregunta


0