Re: Help with Multiple Selects! Sniff! Frustrated!
| From: | Matthew Leverton | Date: | Fri, 23 Jun 2000 15:18:19 +0000 |
| Subject: | Re: Help with Multiple Selects! Sniff! Frustrated! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-2809@lists.php.net to get a copy of this message | ||
Remember that the variable will be an array, and you have to access the
values individually: $variable_name[$index].
You could use some of the Array functions to convert the array into a
comma-delimited string. (Ie... look under the array section in the docs.
You'll find some fancy stuff .)
--START OF THIS_FILE.PHP4--
<?php
for ($i = 0; $i < sizeof($the_select); $i++) {
echo $i . ": " . $the_select[$i] . "<br />";
}
?>
<form action="this_file.php4" method="post">
<select name="the_select[]" multiple>
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
<br />
<input type="submit" />
</form>
--END OF FILE--
--
Matthew Leverton - matthew@aeroinc.net -
http://www.allegro.cc
-----Original Message-----
From: Eduard Ayling <reayling@fibertel.com.ar>
To: php-general@lists.php.net <php-general@lists.php.net>
Date: Friday, June 23, 2000 9:39 AM
Subject: [PHP-GENERAL] Help with Multiple Selects! Sniff! Frustrated!
>I've made up a form with a multiple selects on it, i've tried all kinds of
>combinations, but when I print the variable that was posted i get either
>nothing o an array with the same value.
>I've tried with the normal normal name and i've tried using variablename[]
>in the declaration but it doesn't work.
>Does anyone know what the correct declaration is when using a multiple???
>Or do i have to do something to my code when I receive the variable??
>
>Please help me!
>
>
>
>--
>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
>