Hallo DoL,
it worked when i didn't use urldecode(), just stripslashes():
page-1
$s_array1 = urlencode(serialize($array1));
header("Location: page-2?h_array1=$s_array1");
page-2
$array1 = unserialize(stripslashes($_GET["h_array1"]));
The other way that worked was passing arrays in $_SESSION. You don't need
even serialize them in that case.
D> Hi
D> I would like to pass three arrays, two of them are two dimensional arrays,
D> to another page (or to the same page just submit to itself) using hidden
D> field and the function serialize.
D> (this is a two dimensional array)
D> page-1
D> $s_array1 = serialize($array1);
D> <INPUT type="HIDDEN" name="h_array1" value="<?php echo urlencode($s_array1);
?>>">
D> page-2
D> $array1= unserialize(urldecode(stripslashes($_POST['h_array1'])));
D> it seems to work except there appears to be one NULL record added to the
D> beginning of the array.
D> it affects the following :-
D> count(array_keys($array1) ) returns actual_no_of_keys + 1
D> foreach () echo with one NULL record at the beginning
D> reset($array1) erase the array completely !!
D> and it doesn't help to use rawurl(en|de)code, and with | without
D> stripslashes!
D> PLEASE HELP! if you can resolve this, or has a better ways to pass arrays
D> between pages.
D> Many Thanks
D> /dl
--
Mit freundlichen Gr�ssen
Valeri Felberg
[Web developer]
trimfab - internet mediagroup
------------------------------------------
our mission: innovative business solutions
www.trimfab.com
mailto:[EMAIL PROTECTED]
CZEMINSKI-STR. 1A
10829 BERLIN
GERMANY
FON: +49(0)30 - 768 033 93
FAX: +49(0)30 - 768 033 94
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php