Ver Mensaje Individual
  #18 (permalink)  
Antiguo 09/08/2012, 03:23
fupinet
 
Fecha de Ingreso: julio-2009
Mensajes: 100
Antigüedad: 14 años, 9 meses
Puntos: 4
De acuerdo Respuesta: Unir dos variables de un formulario

pateketrueke gracias ya entendi lo que me decias... cuando te dije que "no" me referia que "no se" como recoger el valor del array.
He incluido lo del join() y funciona tal y como yo lo queria...es incleible lo que hace esa function join() me mire la info y no logro entender como lo hace lo veo dificil... a ver si consigo crear una function para hacer eso y aprender como se hace...
Un saludo y muchas gracias...dejo el codigo completo como me ha funcionado a mi...
Código PHP:
<?php require_once('Connections/cnxGestor.php'); ?>
<?php
mysql_select_db
($database_cnxGestor$cnxGestor);
$query_rsIdiomas "SELECT * FROM idiomas";
$rsIdiomas mysql_query($query_rsIdiomas$cnxGestor) or die(mysql_error());
$row_rsIdiomas mysql_fetch_assoc($rsIdiomas);
$totalRows_rsIdiomas mysql_num_rows($rsIdiomas);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Documento sin título</title>
</head>

<body>
<?php
function crearForm($idioma) {
print <<<HERE
<label>Texto ($idioma): </label>
<input name="texto_$idioma" type="text" value="" /><br /><br />
HERE;
}
?>

<form action="" method="post">
  <?php 
  $separador 
filter_input(INPUT_POST,"separador");
  do { 
  
$idioma $row_rsIdiomas['etiqueta_idioma'];
  
$texto_[$idioma] = filter_input(INPUT_POST,"texto_".$idioma);

  
// el echo solo para ver que imprime  
  
echo $texto_[$idioma] ;

  
crearForm($idioma);
   
  } while (
$row_rsIdiomas mysql_fetch_assoc($rsIdiomas));
  

   
?>
<input name="separador" type="hidden" value="#" />
<input name="enviar" type="submit" value="Enviar" />
</form>

  <?php 
 $texto 
join($separador$texto_);
 echo 
$texto;
   
?>

</body>
</html>
<?php
mysql_free_result
($rsIdiomas);
?>