RE: [PHP] Why doesn't this work? Please trouble-shoot my script.

From: Date: Mon, 05 Feb 2001 17:42:20 +0000
Subject: RE: [PHP] Why doesn't this work? Please trouble-shoot my script.
Groups: php.general 
Request: Send a blank email to php-general+get-38280@lists.php.net to get a copy of this message
> -----Original Message----- > From: chip [mailto:chip.wiegand@simrad.com] > Sent: Monday, February 05, 2001 11:37 AM > To: php-general@lists.php.net; andy@mainetoday.com > Subject: Re: [PHP] Why doesn't this work? Please trouble-shoot my > script. > > > I tried your suggestion, as you can see from the script below, but it > still does not work, I get the word 'array' where I should get the > selected options. > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> > <html> > <head> > <title>Simrad USA Brochures Request Page</title> > </head> > <body> > <form method = post action = 'form_combos.php'> > <? > $name; > $value; > while (list($name, $value) = each($HTTP_POST_VARS)) > { > echo "<input type=\"hidden\" value=\"$value\" > name=\"$name\">\n"; Since you're dealing with a situation where $value may actually be an array, perhaps you should consider serializing it first? (from http://php.net/serialize) serialize - Generates a storable representation of a value Description string serialize (mixed value) Serialize() returns a string containing a byte-stream representation of value that can be stored anywhere. This is useful for storing or passing PHP values around without losing their type and structure. To make the serialized string into a PHP value again, use unserialize(). Serialize() handles the types integer, double, string, array (multidimensional) and object (object properties will be serialized, but methods are lost). --- Mark Roedel | "A wise man once told me that everything in Systems Programmer | life is either a lesson or a joke. Our task LeTourneau University | is to figure out which is which..." Longview, Texas, USA | -- Chris Savage

« previous php.general (#38280) next »