Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/02/2005, 18:10
pahs5809
 
Fecha de Ingreso: abril-2003
Ubicación: Monterrey, Nuevo Leon Mex
Mensajes: 300
Antigüedad: 21 años, 1 mes
Puntos: 3
recoger arrays

Hola disculpen por volver a publicar el mismo problema, pero me urge saber si se puede hacer esto, lo que quiero es capturar una serie de datos que los tengo en 1 array y que estos al momento de recargar la misma pagina me vayan desplegando la informacion que ya se habia capturado , pongo el link y el script para que se den idea http://www.contamax.com/contab/progs/condia01.php

codigo:

<?php
include("../includes/conectar.i");

if($i==0)
{
function array_envia($a_cta)
{
$tmp = serialize($a_cta);
$tmp = urlencode($tmp);
return $tmp;
}
$a_cta = array();
array_push($a_cta,$cta);
$a_scta = array();
array_push($a_scta,$scta);
$a_sscta = array();
array_push($a_sscta,$sscta);
$a_compro = array();
array_push($a_compro,$compro);
$a_dsc = array();
array_push($a_dsc,$dsc);
$a_dh= array();
array_push($a_dh,$dh);
$a_imp = array();
array_push($a_imp,$imp);
}
else
{
function array_recibe($a_cta)
{
$tmp = stripslashes($a_cta);
$tmp = urldecode($tmp);
$tmp = unserialize($tmp);
return $tmp;
}
$a_cta=$_GET['array'];
}
echo " <style type=\"text/css\">"
. " body {"
. " background-color: #E8E4D7;"
. " }"
. " .Estilo1 {"
. " font-family: Arial, Helvetica, sans-serif;"
. " font-weight: bold;"
. " font-size: 10pt;"
. " }"
. " .Estilo2 {font-family: Arial, Helvetica, sans-serif}"
. " -->"
. " </style>"
. " <table width=\"767\" cellspacing=\"1\" border=\"\">"
. " <tr>"
. " <th scope=\"col\"><img src=\"../images/logoconta.jpg\" width=\"227\" height=\"43\" align=\"left\"\"></th>"
. " </tr>"
. " </table>"
. "<div align=\"center\">"
. "<link rel=\"StyleSheet\" href=\"../style.css\" type=\"text/css\">"
. " <center><br>";
if($npol=='' or $fpol=='')
{
echo "<style type=\"text/css\">"
." <!--"
.".Estilo1 {"
."color: #0000FF;"
."font-weight: bold;"
."}"
."-->"
."</style>"
."<table width=\"250\" border=\"1\">"
." <form method=\"POST\" action=\"condia01.php?npol=$npol\">"
."<tr>"
." <td width=\"134\"><div align=\"center\">Numero de Poliza </div></td>"
." <td><input value=\"$npol\" name=\"npol\" type=\"text\" id=\"npol\" size=\"4\" maxlength=\"4\"></td>"
." </tr></form>"
." <form method=\"POST\" action=\"condia01.php?npol=$npol\">"
."<tr>"
." <td width=\"134\"><div align=\"center\">Fecha de Poliza</div></td>"
." <td><input value=\"$fpol\" name=\"fpol\" type=\"text\" id=\"fpol\" size=\"10\" maxlength=\"10\"></td>"
." </tr></form>"
."</div>"
." </table>";
}
else
{
echo "<table width=\"780\" border=\"0\">"
." <tr>"
." <td width=\"62\"><b>Poliza</b></td>"
." <td width=\"89\">$npol</td>"
." <td width=\"900\">&nbsp;</td>"
." <td width=\"84\"><b>Cargos</b></td>"
." <td width=\"88\">7546.00&nbsp;</td>"
."</tr>"
."<tr>"
." <td><b>Fecha</b></td>"
."<td>$fpol</td>"
."<td><div align=\"center\" class=\"Estilo1\">Captura de Polizas</div></td>"
."<td><b>Creditos</b></td>"
."<td>8465.00</td>"
."</tr>"
."</table>"
."<br>"
."<table width=\"740\" border=\"1\">"
."<tr>"
."<td width=\"3%\"><div align=\"center\">Cuenta</div></td>"
."<td width=\"3%\"><div align=\"center\">S-Cuenta</div></td>"
."<td width=\"5%\"><div align=\"center\">Sub-S-Cta</div></td>"
."<td width=\"3%\"><div align=\"center\">Comprobante</div></td>"
."<td width=\"65%\"><div align=\"center\">Descripcion</div></td>"
."<td width=\"3%\"><div align=\"center\">D / H</div></td>"
."<td width=\"15%\"><div align=\"center\">Importe</div></td>"
."</tr>";
$i=0;
while($i < 9)
{
echo "<tr><form method=\"POST\" action=\"condia01.php?a_cta=$a_cta&a_sct=$a_sct&ss c=$a_ssc&a_dsc=$a_dsc&a_dh=$a_dh&a_imp=$a_imp&i=$i &npol=$npol&fpol=$fpol\">"
."<td>";
if($a_cta[$i]=='')
{
echo"<input value=\"$a_cta[$i]\" name=\"array_push($a_cta,$cta)\" type=\"text\" id=\"array_push($a_cta,$cta)\" size=\"4\" maxlength=\"3\"></td>";
}
else
{
echo $a_cta[$i];
}
echo "<td>"
."<input value=\"$a_scta[$i]\" name=\"array_push($a_scta,$scta)\" type=\"text\" id=\"array_push($a_scta,$scta)\" size=\"4\" maxlength=\"3\"></td>"
."<td>"
."<input value=\"$a_sscta[$i]\" name=\"array_push($a_sscta,$sscta)\" type=\"text\" id=\"ssc[$i]\" size=\"4\" maxlength=\"3\"></td>"
."<td>"
."<input value=\"$a_compro[$i]\" name=\"array_push($a_comp,$compro)\" type=\"text\" id=\"array_push($a_compro,$compro)\" size=\"4\" maxlength=\"3\"></td>"
."<td>"
."<input value=\"$a_dsc[$i]\" name=\"array_push($a_dsc,$dsc)\" type=\"text\" id=\"array_push($a_dsc,$dsc)\" size=\"70\" maxlength=\"70\"></td>"
."<td>"
."<input value=\"$a_dh[$i]\" name=\"array_push($a_dh,$dh)\" type=\"text\" id=\"array_push($a_dh,$dh)\" size=\"2\" maxlength=\"3\"></td>"
."<td>"
."<input value=\"$a_imp[$i]\" name=\"array_push($a_imp,$imp)\" type=\"text\" id=\"array_push($a_imp,$imp)\" size=\"11\" maxlength=\"11\"></td>"
;
$i++;
}
echo " <table width=\"100\" cellspacing=\"0\" border=\"\">"
. " <tr>";
echo" <input type=\"image\" src=\"../images/bot-aceptar-on.gif\" name=\"imp\"></td>"
."</tr></form></table>";

}
echo "</table>";



//echo "$a_cta[0],$a_cta[1],$a_cta[2]";

?>
<?
/*function array_recibe($url_array) {
$tmp = stripslashes($url_array);
$tmp = urldecode($tmp);
$tmp = unserialize($tmp);

return $tmp;
}


$array=$_GET['array'];
// el método de envio usado. (en el ejemplo un link genera un GET. En el formulario se usa POST podria ser GET tambien ...)

$array=array_recibe($array);

foreach ($array as $indice => $valor){
echo $indice." = ".$valor."<br>";
} */

/// fin de codigo


No esta afinado el codigo porque me pare por lo del envio de arrays

Gracias por la ayuda que me puedan brindar