Cita:
Iniciado por GatorV
Pues no porque estas leyendo los valores de $_POST, como $_POST['local'] etc, tienes que usar las variables locales que estas definiendo dentro del for...
Me pregunto si realmente estas tratando de entender lo que te estoy explicando, o solo haciendo copy/paste sin entender...

Vuelve a perdonarme, ya te avise que era novato. Esto queda tal que así:
Código HTML:
Ver original<div id="TabbedPanels2" class="TabbedPanels"> <ul class="TabbedPanelsTabGroup"> <li class="TabbedPanelsTab" tabindex="0">Dirección
</li> <li class="TabbedPanelsTab" tabindex="0">Dirección 2
</li> <li class="TabbedPanelsTab" tabindex="0">Dirección 3
</li> <div class="TabbedPanelsContentGroup"> <div class="TabbedPanelsContent"> <th scope="col">Calle
</th> <input name="NUM_DIR[]" type="hidden" size="" value="1" /> <th scope="col"><input name="calle[]" type="text" size="30"value="" /></th> <th scope="col"><input name="numero[]" type="text" size="1"value="" /> EDF
<input name="edificio[]" type="text" size="1"value="" /> PTA
<input name="puerta[]" type="text" size="1"value="" /> PISO
<input name="piso[]" type="text" size="1"value="" /> LTA
<input name="letra[]" type="text" size="1"value="" /></th> <th scope="col">Localidad
</th> <th scope="col"><input name="localidad[]" type="text" size="30" value="" /></th> <th scope="col">Provincia
</th> <th scope="col"><input name="provincia[]" type="text" size="30" value="" /></th> <th scope="col">Email
</th> <th scope="col"><input name="email[]" type="text" size="30" value=""/></th> <div class="TabbedPanelsContent"> <th scope="col">Calle
</th> <input name="NUM_DIR[]" type="hidden" size="" value="2" /> <th scope="col"><input name="calle[]" type="text" size="30"value="" /></th> <th scope="col"><input name="numero[]" type="text" size="1"value="" /> EDF
<input name="edificio[]" type="text" size="1"value="" /> PTA
<input name="puerta[]" type="text" size="1"value="" /> PISO
<input name="piso[]" type="text" size="1"value="" /> LTA
<input name="letra[]" type="text" size="1"value="" /></th> <th scope="col">Localidad
</th> <th scope="col"><input name="localidad[]" type="text" size="30" value="" /></th> <th scope="col">Provincia
</th> <th scope="col"><input name="provincia[]" type="text" size="30" value="" /></th> <th scope="col">Email
</th> <th scope="col"><input name="email[]" type="text" size="30" value=""/></th> <div class="TabbedPanelsContent"> <th scope="col">Calle
</th> <input name="NUM_DIR[]" type="hidden" size="" value="3" /> <th scope="col"><input name="calle[]" type="text" size="30"value="" /></th> <th scope="col"><input name="numero[]" type="text" size="1"value="" /> EDF
<input name="edificio[]" type="text" size="1"value="" /> PTA
<input name="puerta[]" type="text" size="1"value="" /> PISO
<input name="piso[]" type="text" size="1"value="" /> LTA
<input name="letra[]" type="text" size="1"value="" /></th> <th scope="col">Localidad
</th> <th scope="col"><input name="localidad[]" type="text" size="30" value="" /></th> <th scope="col">Provincia
</th> <th scope="col"><input name="provincia[]" type="text" size="30" value="" /></th> <th scope="col">Email
</th> <th scope="col"><input name="email[]" type="text" size="30" value=""/></th>
Código PHP:
Ver original}
$id_aviso=$_POST['id_aviso'];
$localidad = $_POST['localidad'];
$provincia= $_POST['provincia'];
$calle = $_POST['calle'];
$numero = $_POST['numero'];
$edificio= $_POST['edificio'];
$puerta = $_POST['puerta'];
$piso = $_POST['piso'];
$letra= $_POST['letra'];
$email = $_POST['email'];
$NUM_DIR = $_POST['NUM_DIR'];
$total = count($localidad); for ($i = 0; $i < $total; $i++) {
$local = $localidad[$i];
$prov = $provincia[$i];
$call = $calle[$i];
$nume = $numero[$i];
$edif = $edificio[$i];
$puer = $puerta[$i];
$pis = $piso[$i];
$letr = $letra[$i];
$emai = $email[$i];
$NUM_D = $NUM_DIR[$i];
$insertSQL = sprintf("INSERT INTO dir_usuarios (localidad,provincia,calle,numero,edificio,puerta,piso,letra,email,id_aviso,NUM_DIR)VALUES ('$local', '$prov', '$call', '$nume', '$edif','$puer','$pis','$letr', '$emai', '$id_aviso', '$NUM_D')", GetSQLValueString($_POST['localidad'], "text"),
GetSQLValueString($_POST['provincia'], "text"),
GetSQLValueString($_POST['calle'], "text"),
GetSQLValueString($_POST['numero'], "text"),
GetSQLValueString($_POST['edificio'], "text"),
GetSQLValueString($_POST['puerta'], "text"),
GetSQLValueString($_POST['piso'], "text"),
GetSQLValueString($_POST['letra'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['id_aviso'], "int"),
GetSQLValueString($_POST['NUM_DIR'], "int"));
}
Una pregunta que quiero hacerte es que en un primer formulario que tengo donde ingreso los datos del cliente y luego recupero esos datos con un id autoincrement y vuelvo a ingresar los datos de la dirección con dicho id. Habitualmente se hace así o puedo hacerlo de otra forma mas rápida. Siempre tengo que hacer un INSERT detras de otro para poder sacar el id que las une no
PD:Gracias por no haberme hecho el código desde el principio