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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to