Hello Micah--
Yes, PHP supports multiple selections, but you need to change the name
of the control from submitID to submitID[], so that it will become an
array once inside your script.
Hope this helps!
Marco
--
------------
php|architect - The Magazine for PHP Professionals
The monthly magazine dedicated to the world of PHP programming
Check us out on the web at http://www.phparch.com!
--- Begin Message ---
grrr... I am trying to get several values from a selection form field (using
multiple) into PHP. Is this possible? The code I'm using to test this is
below. After running the code and selecting more than one field, the last
field (the greatest number) is the only one that shows up as the only input
from the selection part of the form!! Is there any other way??
thanks,
Micah
<?php
$phpSelf = $_SERVER['SCRIPT_NAME'];
$phpFile = $_SERVER['SCRIPT_FILENAME'];
$phpName = 'Multiple Selection Test';
$phpTimeRan = date('H:i.s');
$a='a';
$b='b';
?>
<html>
<head><title><?php echo $phpName; ?></title></head>
<body>
<h2><?php echo $phpName; ?></h2>
<i>[<?php echo $phpSelf; ?>] @ <?php echo $phpTimeRan; ?></i>
<br><br>
<form action="<?php echo $phpSelf; ?>" method="POST">
<table
bgcolor="#003300"
cellpadding="4"
cellspacing="0"
border="4"
bordercolor="#000000"
style="color:#ffffff;">
<tr><td>Item</td></tr>
<tr> <td><select name="submitID" size="5" MULTIPLE>
<?php
for ($i=0;$i<10;$i++) {
echo '<option value="'.$i.'">'.$i.'</option>'."\n";
}
?>
</select></td>
</tr>
</table>
<br><br>
<input type="hidden" name="a" value="<?php echo $a; ?>">
<input type="hidden" name="b" value="<?php echo $b; ?>">
<input type="submit" name="submit">
</form>
<?php
echo '<textarea readonly rows="12" cols="50" name="NULL">';
var_dump($_POST);
echo '</textarea>';
echo '<br><br><hr>';
highlight_file($phpFile);
?>
</body>
</html>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php