Thanks, I found the problem was with the creation of the 2-di array. ----- Original Message ----- From: "Martin Towell" <[EMAIL PROTECTED]> To: "'DoL'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, July 31, 2002 12:21 PM Subject: RE: [PHP] passing arrays between pages with serialize
> Can you post/send the results of doing a print_r() on the first page (the > one that's serialising) and the results of the serialize()? > > -----Original Message----- > From: DoL [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 31, 2002 2:21 PM > To: [EMAIL PROTECTED] > Subject: [PHP] passing arrays between pages with serialize > > > Hi > > I would like to pass three arrays, two of them are two dimensional arrays, > to another page (or to the same page just submit to itself) using hidden > field and the function serialize. > > (this is a two dimensional array) > page-1 > $s_array1 = serialize($array1); > > <INPUT type="HIDDEN" name="h_array1" value="<?php echo urlencode($s_array1); > ?>"> > > page-2 > $array1= unserialize(urldecode(stripslashes($_POST['h_array1']))); > > it seems to work except there appears to be one NULL record added to the > beginning of the array. > it affects the following :- > count(array_keys($array1) ) returns actual_no_of_keys + 1 > foreach () echo with one NULL record at the beginning > reset($array1) erase the array completely !! > > and it doesn't help to use rawurl(en|de)code, and with | without > stripslashes! > > PLEASE HELP! if you can resolve this, or has a better ways to pass arrays > between pages. > > Many Thanks > /dl > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php