Re: HTTP_POST_VARS and Arrays
| From: | David Robley | Date: | Tue, 04 Jul 2000 01:57:04 +0000 |
| Subject: | Re: HTTP_POST_VARS and Arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4645@lists.php.net to get a copy of this message | ||
On 4 Jul, Matt Allen wrote:
> Hi,
>
> Thats cool in theory, but shouldnt this test pass:
>
> if (is_array($HTTP_POST_VARS["field_name"])) {
> echo "ok";
> }
>
> it doesnt. Its like Field_Name isnt even getting passed though, like an
> unchecked checkbox !
>
> Matta
>
That's pretty much what I would expect if there are no selections made.
But I would expect that you should get some sort of a result if there
are any selections; so what you might try is first up testing if the
element in HTTP_POST_VARS isset() or !empty(); depending on the result
test if it's an array ang go from there.
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA