Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/02/2014, 12:39
RaulCDT
 
Fecha de Ingreso: febrero-2014
Ubicación: Murcia
Mensajes: 119
Antigüedad: 10 años, 2 meses
Puntos: 0
No consigo meter datos a la BD

O esto ha cambiado mucho o no se porque no me funciona ahora

Tengo este formulario de prueba:

Código HTML:
<form method="post" action="alta2_action.php">
  <table width="470" height="18"  cellpadding="2" cellspacing="2" class="estilotabla">
    <tr>
      <td colspan="6" class="estilocelda">INSERTAR NUEVO CLIENTE  </td>
    </tr>
    <tr>
      <td width="79">&nbsp;</td>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td>Nombre:</td>
      <td width="106" class="volver"><label>
        <input type="text" name="nombre" id="nombre" />
      </label></td>
      <td width="91" class="volver">Apellidos:</td>
      <td class="volver"><input type="text" name="apellidos" id="apellidos" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="3" class="volver">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>

      <td colspan="3">
        <input name="boton" type="submit" class="input147" style="height:17px" value="prueba" /></td>
    </tr>
  </table>
</form> 

y luego el action es:

Código PHP:
<?php 
//Conexion
   
include("conex.php"); 

//Valores
   
$link=Conectarse();  
   
$id=$_POST['id'];
   
$nombre=$_POST['nombre'];
   
$apellidos=$_POST['apellidos'];

   
//Consulta para actualizar
mysql_query("insert into prueba (id,nombre,apellidos) values ('','$nombre','$apellidos')",$link);

//Cerramos la conexion a DB
header("location: alta.php");

?>
Y no me inserta datos ninguno! A que se debe?