Re: passing an array via GET and a hidden form element
| From: | John W. Holmes | Date: | Sun, 02 Nov 2003 17:13:50 +0000 |
| Subject: | Re: passing an array via GET and a hidden form element | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168339@lists.php.net to get a copy of this message | ||
Robb Kerr wrote:
I'm trying to pass a variable from a search page to the results page via GET. The $MANUFACTURERS variable contains an array and is obtained from the URL. I've tried the following to no avail... <input name="manufacturer[]" type="hidden" multiple id="manufacturer[]" value=<?php $manufacturer ?>> [snip]<input name="manufacturer" type="hidden" multiple id="manufacturer" value="<?php echo htmlentities(serialize($manufacturer)); ?>"> Then to get the array back on the receiving page: $manufacturer = unserialize($_GET['manufacturer); Or just stick the array in the session... $_SESSION['manu'] = $manufacturer; and on receiving page: $manufacturer = $_SESSION['manu']; -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com