Re: POST-ing or GET-ing an array

From: Date: Tue, 29 Oct 2002 19:36:03 +0000
Subject: Re: POST-ing or GET-ing an array
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-121928@lists.php.net to get a copy of this message
> Hey, > I think you should be able to serialize and urlencode the array and then > pass that via get/post.....post would be a lot better as get is limited to > so many chars. Something like: > $sql = "select stuff from my_table"; > $result = mysql_query($sql); > while ($myrow = mysql_fetch_assoc($result)) { > $id = $myrow["id"]; > $my_array[] = $id; > } > echo '<a href="next_page.php?array='. urlencode(serialize($my_array)) > .'">Next</a>'; You'll need to unserialize+urldecode the array at > the other > end. This is way nicer :-) Sascha

« previous php.general (#121928) next »