Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/09/2014, 11:11
robertocarrillo
 
Fecha de Ingreso: septiembre-2014
Mensajes: 79
Antigüedad: 10 años, 6 meses
Puntos: 0
Respuesta: Autocompletar form con info de DB

Código PHP:
Ver original
  1. <?
  2. <form action="" method="post">
  3. <input type="text"  name="codigo_postal" value="" />
  4. <input type="submit" name="enviar" value="enviar"/>
  5. </form>
  6. <?
  7. $r=  mysql_query("SELECT * FROM tabla WHERE codigo postal=".$_POST["codigo_postal"].";",$conexion);
  8. $resultado_r= mysql_fetch_array($r);
  9. ?>
  10. <input type="text" name="cuidad" value="<? echo $resultado_r["provincia"]?>"/>
Hola, es eso lo que necesitas? Saludos.