Ver Mensaje Individual
  #10 (permalink)  
Antiguo 28/01/2011, 16:21
oscarbt
 
Fecha de Ingreso: abril-2009
Ubicación: Colombia
Mensajes: 949
Antigüedad: 15 años
Puntos: 27
Respuesta: Como hago llegar los datos del formulario a la BD

Viendo tu codigo, yo optaria lo siguiente:

como tal el formulario de registro:

Código HTML:
Ver original
  1. <form id="form1" name="form1" method="post" action="verificar.php">
  2. <table width="100%" border="0" align="center">
  3. <tr>
  4. <td>NAME:</td>
  5. <td><label for="name"></label>
  6. <input name="name" type="text" id="name" size="31" /></td>
  7. </tr>
  8. <tr>
  9. <td>EMAIL:</td>
  10. <td><input name="email" type="text" id="email" size="31" /></td>
  11. </tr>
  12. <tr>
  13. <td colspan="2"><input type="submit" name="button" id="button" value="Sign Up" /></td>
  14. </tr>
  15. </form>


Y ahora en verificar.php:

Código PHP:
Ver original
  1. <?
  2.     $link = mysql_connect ("localhost","root","root");
  3.     if (!$link)
  4.         die("Error en la conexion con MySQL");
  5.    
  6.     mysql_select_db (tubasededatos,$link);
  7.  
  8.  
  9. $resultado=mysql_query("INSERT INTO tu_tabla(campo1,campo2)
  10. VALUES ('{$_POST['name']}','{$_POST['email']}'  )",$link);
  11.  
  12. echo "<h2> El registro se ha guardado</h2>"
  13.  
  14. mysql_close ($link);
  15.  
  16. ?>

Intenta asi, verifica bien los nombres de los campos en la tabla de la base de datos....