Re: POST arrays?

From: Date: Thu, 20 Apr 2006 11:59:17 +0000
Subject: Re: POST arrays?
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-234357@lists.php.net to get a copy of this message
"Why do you want to post it to itself? Why not use a session instead? " -I dont know. Never tried "session" "It's a lot more efficient." -OK. Is it more complicated to write? -Will "Stut" <stuttle@gmail.com> kirjoitti viestissä:4447718A.9080700@gmail.com... > William Stokes wrote: > >>Can someone help me to get started with serializing? I think I did'nt >>quite understand the manual here... >> >>How to post to $PHP_SELF and read this simple array? >> > > Why do you want to post it to itself? Why not use a session instead? It's > a lot more efficient. > >><? >>//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); >> > You need to put the unserialized array somewhere, change this to > $arr_siirt_jouk = 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')); >> > Here you are still putting an array into the input field. You probably > want > $arr_siirto = serialize(array('1','2','3')); > >><input type="hidden" name="arr_siirt_jouk" value="<?php echo >>"$arr_siirto";?>"> >>?> >> >>Which, to my great surprice, didn't work :) >> > I was surpriced too! Is the manual really that poorly written? I can't see > how you got to your code by following the examples provided. > > -Stut

« previous php.general (#234357) next »