Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/12/2007, 03:15
sk1one
 
Fecha de Ingreso: diciembre-2007
Mensajes: 149
Antigüedad: 16 años, 4 meses
Puntos: 1
Exclamación A ver si lo veis en que falla :( curiosa cosa :O

Pues nada que este código trata de imprimir unos valores de una array que devuelve una clase que me he creado, he provado si los valores del array devueltos estan correctos y se se imprimen pero solo cuando utilizo el bucle foreach, en cambio si uso un for o while no me imprime nada, curioso esto, pero nose porque y voy a ver si alguno de vosotros me lo puede decir porque ya nose que hacer, alla va el código máquinas.:
Código HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>DATOS DE SOLICITUD</title>

</style>
</head>

<body> 
Código PHP:
<?php 
    
require_once('php/librerias/clases.php');

    
$a = new formulario();
    if((
$a->vaciosqs('27','hiddenField','GET'))==true)
    {
        echo 
"Existen campos sin completar, rellene correctamente los campos";
        exit;
    }
    else
    {

        
$Array=array();
        
$Array=$a->valoreshiddenqs('27','hiddenField','GET');
}
?>
Código HTML:
<table width="100%" border="1" cellpadding="0" cellspacing="0">
  <tr>
	<th colspan="21">Datos Personales </th>
  </tr>
  <tr>
    <th width="4" rowspan="2">&nbsp;</th>
	<th width="60">Usuario</th>
	<th width="43">Email</th>
	<th width="89">Contrase&ntilde;a</th>
	<th width="61">Nombre</th>
	<th colspan="2">Apellidos</th>
	<th colspan="2">DNI</th>
	<th width="68">Empresa</th>
	<th width="73">Direccion</th>
	<th width="31">C.P.</th>
	<th width="77">Poblaci&oacute;n</th>
	<th width="72">Provincia</th>
	<th width="33">Pa&iacute;s</th>
	<th colspan="2">Telf. Fijo </th>
	<th colspan="2">Telf. Movil</th>
	<th width="20" colspan="2" rowspan="2">&nbsp;</th>
  </tr>
  <tr> 
Código PHP:
<?php 
    
foreach($Array as $valor)
    {
        
$cont++;
        if(
$cont <= 18)
        {
            echo 
'<td>'.$valor.'</td>';
            
        }
        else{break;}
    }
?>
Código HTML:
</tr>
  <tr>
    <td colspan="21">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <th colspan="21">Datos Bancarios </th>
  </tr>
  <tr>
    <th>&nbsp;</th>
    <th>Nombre</th>
    <th colspan="2">Apellidos</th>
    <th colspan="2">DNI</th>
    <th colspan="15">Num. Cuenta </th>
  </tr>
  <tr> 
Código PHP:
<?php 
//echo '<td>&nbsp;</td>';
    
for($datosB=18;$datosB<28;$datosB++)
    {
        
        echo 
'<td>'.$Array[$datosB].'</td>';
    }

//echo '<td colspan="11">&nbsp;</td>';
?>
</tr>
Código HTML:
</table>
</body>
</html> 
Nada a ver si lo veis gracias el menos por leerlo :(