Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/05/2009, 17:29
Avatar de By_George
By_George
 
Fecha de Ingreso: abril-2009
Ubicación: localhost
Mensajes: 629
Antigüedad: 15 años
Puntos: 19
Respuesta: Como crear un nombre de imput en secuencia?

crea un contador antes del foreach para que ese le cambie el nombre a tu input, algo asi:

Código PHP:
<?php 
$xmlstr 
file_get_contents'notas.xml' );   
$content = new SimpleXMLElement$xmlstr );   
$c2 $content->$featured->title[0];

echo 
'<table>';   
echo 
'<tr>';   
echo 
'<th>Codigo</th><th>Texto</th>  
       <th>Direccion</th><th>-</th>'
;   
echo 
'</tr>';
$cont=1;
foreach( 
$content->featured as $featured ) {   
    echo 
'<tr>';   
    echo 
'<td><input type="text" name="nombre'.$cont.'" VALUE="' $featured->title  '"  size="10"></td>';   
    echo 
'<td>' $featured->copy '</td>';   
    echo 
'<td>' $featured->image '</td>';   
    echo 
'<td>' $featured->link '</td>';   
    echo 
'</tr>';   
}   
echo 
'</table>';  

?>
__________________
La estadística es una ciencia que demuestra que si mi vecino tiene dos coches y yo ninguno, los dos tenemos uno.