Re: HTTP_POST_VARS and Arrays
| From: | Mike Wright | Date: | Tue, 04 Jul 2000 16:10:49 +0000 |
| Subject: | Re: HTTP_POST_VARS and Arrays | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4766@lists.php.net to get a copy of this message | ||
Erik Stainsby wrote:
>
> Actually isn't that the default behaviour of FORM vars --
> if there is no value they do not appear in the transaction
> on the server side after a submit?
>
> Isn't that why we all have to write in those
> if(!isset(blah)) ... statements?
>
> Doens't look to me like anything is busted.
>
> -- Erik
>
> ----- Original Message -----
> From: "Matt Allen" <Matt@LinuxWorx.com.au>
> To: "Rasmus Lerdorf" <rasmus@php.net>
> Cc: <php-general@lists.php.net>
> Sent: Monday, July 03, 2000 11:58 PM
> Subject: Re: [PHP] HTTP_POST_VARS and Arrays
>
> > Hi Rasmus,
> >
> > Like this
> >
> > <form action=test.php method=POST>
> > <select name=blah[] MULTIPLE>
> > <option value=1>One</option>
> > <option value=2>Two</option>
> > <option value=3>Three</option>
> > </select>
> > </form>
> >
> > If you dont select one of the options $blah will not show up on test.php
> > at all.
> >
> > Its pretty weird, thats why i asked.
> >
> > Matta
> >
> > Rasmus Lerdorf wrote:
> > >
> > > > When im walking the HTTP_POST_VARS array im not getting any data from
> > > > the submitted form if the element in the form was an array.
> > > >
> > > > For instance, If it it a multiple select list and nothing is selected
> > > > then the form element doesnt even appear in the HTTP_POST_VARS array,
> > > > not even as a NULL.
> > >
> > > What do you mean nothing is selected? How do you make a select multiple
> > > tag without a default selection?
> > >
> > > -Rasmus
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
Hi all,
That's close. If an input is blank its name will still be sent in.
eg "http://some.domain.net/action.php?input1=&input2=".
The sxception is input type radio. If it's not selected it won't even be
mentioned.
hope that helps,
mike w.
> > --
> > Matt Allen Linux/PHP eCommerce
> > Solutions
> > Linux Worx Linux Networking
> > www.linuxworx.com.au Consulting
> > matt@linuxworx.com.au
> > 0413 777 771
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Before dot there was dot dot.