[thelist] RE: Arrays and Multiple Select?

Les Lytollis les.lytollis at morse.com
Thu Oct 11 11:16:52 CDT 2001


Does "$type_of_event[]" show up as "array" when you substitute
$HTTP_POST_VARS? You need to add the "[]" in the form and not in the action
script.

Hope that makes sense - email me off-list if you are still having problems -
I tried it just now and php handled it fine - I'll send the test code if you
want

Lez


--------------------------------------
Lez Lytollis
Internet Developer, Morse Professional Services
Morse Group Ltd
Tel: +44 (0)1332 826029 Fax: +44 (0)1332 826044
www.morse.com

This email and any attachments are confidential and are intended only for
the addressee. If you are not the intended recipient of this email and have
received it in error, please notify the sender immediately by reply email
and then delete it from your system.
 

> -----Original Message-----
> From: McAtee, Malcolm [mailto:MMcAtee at philamuseum.org]
> Sent: 11 October 2001 16:02
> To: thelist at lists.evolt.org
> Subject: RE: [thelist] RE: Arrays and Multiple Select?
> 
> 
> Yeah....Ive done that, still getting the error....
> 
> //---------------//
> Malcolm J. Mcatee
> Web Designer
> Philadelphia Museum of Art
> 215-684-7748
> mmcatee at philamuseum.org
> //---------------//
> 
> -----Original Message-----
> From: Les Lytollis [mailto:les.lytollis at morse.com]
> Sent: Thursday, October 11, 2001 8:57 AM
> To: 'thelist at lists.evolt.org'
> Subject: [thelist] RE: Arrays and Multiple Select?
> 
> 
> Name your select box "Type_Of_Event[]" and bingo! php knows 
> it has an array
> to handle
> 
> Incindentally, if you use $HTTP_POST_VARS as the array in the 
> while loop,
> you can see exactly what your form is posting.
> 
> HTH
> Lez
> > This gives me the following error message:  
> > 
> > "Variable passed to each() is not an array or object in
> > /export/web/company/philamuseum/public_html/information/develo
> > pment/thankyou
> > .php3 on line 23"
> > 
> > I find this encouraging actually. Any idea how to correct this?
> > Thanks Malcolm
> > 
> > ==============================================================
> > ==========
> > <?php
> > 
> > while(list($key, $value) = each($Type_Of_Event)) {   
> > =====line 23is here!
> >        echo "$key = $value<br>";
> >        }
> > 
> > 
> 
> 
> <TIP Type="PHP" Author="Lez">
> If you often use n-dimensional arrays in your code this is a 
> handy little
> helper function you can use to see what going on
> 
> <pre>
>   <?php
>     function get_array_elems($arrResult, $where = "array") {
>       while(list($key,$value)=each($arrResult)) {
>         if (is_array($value)){
>           get_array_elems($value, $where . "[$key]");
>         }
>         else {
>           echo "$key=$value<br>\n";
>         }
>       }
>     }  
>   ?>
> 
> </pre>
> 
> </TIP>
> 
> 
> 
> 
> 
> 
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 
> 
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 
> 




More information about the thelist mailing list