[thelist] RE: Arrays and Multiple Select?

McAtee, Malcolm MMcAtee at philamuseum.org
Thu Oct 11 11:01:26 CDT 2001


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 ! 




More information about the thelist mailing list