Ver Mensaje Individual
  #13 (permalink)  
Antiguo 13/08/2011, 08:55
jc92
 
Fecha de Ingreso: abril-2010
Mensajes: 116
Antigüedad: 14 años
Puntos: 3
Respuesta: avannzando en el registro de usuario

Problema mas grave !!

Ahora se me envian los datos

Pero en el html, formulario

formulario.html

<html>
<head>
<title>Novedades</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="guardar.php" method="post" name="form1" id="form1">
<p>Nombre :
<label for="textfield"></label>
<label for="textfield3"></label>
<input type="text" name="nombre" id="nombre">
</p>
<p>Apellido :
<label for="textfield2"></label>
<label for="textfield2"></label>
<input type="text" name="apellido" id="apellido">
</p>
<p>
<input type="submit" name="button" id="button" value="Enviar">
</p>
</form>
</body>
</html>

guardar.php

<?php
$sitio="localhost";
$usuario="admin";
$pass="hermanos2";
$base="sport";
$con=mysql_connect($sitio,$usuario,$pass);
if(mysql_select_db($base,$con)){
$consulta ="insert into users values ('nombre','apellido')";
if(mysql_query($consulta,$con))
{
echo "listo";
}
else
{
echo mysql_error($con);
}
}
else
{
echo mysql_error($con);
}
?>

Se envian pero en la base de datos sale nombre apellido pk pone que la variable no esta definida :(

http://img74.xooimage.com/files/a/6/...n2-2bc60e2.png

y eso que cuando le doy a enviar se envia correctamente.