Re: POST arrays?

From: Date: Thu, 20 Apr 2006 11:33:33 +0000
Subject: Re: POST arrays?
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-234353@lists.php.net to get a copy of this message
William Stokes a écrit :
Can someone help me to get started with serializing? I think I did'nt quite understand the manual here... serialize and unserialize don't modify your variable, but the return value is a string or a "mixed" (which means it can be a very complicated structure, or a simple
array, an object, etc). first_script.php : $string_from_array = serialize($array); <form action="second_script.php" method="post"> <input type="hidden" name="art_siirt_jouk" value="$string_from_array"> <button type="button" value="submit"> </form> second_script.php : print_r($POST); $string = $_POST["art_siirt_jouk"]; $array = unserialize($string); hope this'll help. N F
How to post to $PHP_SELF and read this simple array? <? //print the posted array here print_r($arr_siirt_jouk); //create the array and post it in another name $arr_siirto = array(1,2,3); <input type="hidden" name="arr_siirt_jouk" value="<?php echo "$arr_siirto";?>"> ?> I tried: <? //print the posted array here unserialize($arr_siirt_jouk); print_r($arr_siirt_jouk); //create the array and post it in another name $arr_siirto = array((serialize('1','2','3')); <input type="hidden" name="arr_siirt_jouk" value="<?php echo "$arr_siirto";?>"> ?> Which, to my great surprice, didn't work :) Thanks -Will


« previous php.general (#234353) next »