Problems with array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gsamper
Forum Newbie
Posts: 1
Joined: Thu Dec 05, 2002 9:55 am

Problems with array

Post by gsamper »

Well i have some problems when i pass the values of arrays in html forms.

My code is:

<?PHP
include("Login.php");
session_start();
session_register("MSG_ERROR");

$connect2 = odbc_connect("BD","","");
if( !$connect2 ){
echo "Error en la conexion a la base de datos";
exit;}
$con2="SELECT * FROM Partidas WHERE partidas.co_number=". "'$Pedi1'" . "and Partidas.Genero=". "'$val7'";

$consulta2 = odbc_exec( $connect2, $con2);
if( !$consulta2 ){
echo " Error en la consulta a la tabla Partidas";
exit;}
echo '
<TABLE BORDER=0>
$x=0;
while( odbc_fetch_row( $consulta2 ) ){
$val8=odbc_result( $consulta2 , 1 );
$val9=odbc_result( $consulta2 , 2 );
echo "<TR>";
echo '<TD><INPUT TYPE="TEXT" NAME="id_par[]" SIZE="14" VALUE="';echo $val8;echo '" onFocus="this.blur()"></TD>';
echo '<TD><INPUT TYPE="TEXT" NAME="par['.$x.']" SIZE="5" VALUE="';echo $val9;echo '" onFocus="this.blur()"></TD>';
echo "</TR><BR>";
$x = $x + 1;
}

echo '
</TABLE><BR><BR>
<CENTER>
<INPUT TYPE="SUBMIT" VALUE="Continuar>>" name="DONE">
</CENTER>
</FORM>
</FONT>
</BODY>
</HTML>';
?>

This code works fine and generates 15 inputs but when a try to read the values from arrays it's only have 10 values. I don't know the reason.

the script where i try to read the values is:


<?PHP
include("Login.php");
session_start();
session_register("MSG_ERROR");


$id_par[] = $_REQUEST['id_par'];
$par[] = $_REQUEST['par'];


for ($i = 0; $i <sizeof($id_par); $i++) {
echo $id_par[$i] . "-i:" . $i;
echo "<BR>";
}

?>

And i have only 10 values. Somebady help me!! :cry:

I discovered the problem, the problem aren't the arrays.
I thing it's the capacity of PHP to pass values. I was modifiying the php.ini, but i didn't found the value that increments the amount or memory to pass that amount of values. I don't know if my apache version has that limitant. Somebody knows the solution for that problem. :lol: :lol:
Post Reply