hey,
since u are slecting multiple options you'll have to use an array
here's how.i u need explanation,feel free to mail me:

<?
if ($select==""){
  print"
<form method=\"post\" name=\"select\" action=\"test.php3\">
<SELECT MULTIPLE NAME=\"select[]\">
<Option VALUE=\"Chocolate\">Chocolate/Chocolate Chip
<Option VALUE=\"Peanut\">Peanut Brittle/Vanilla
<Option Selected VALUE=\"Cookie\">Cookie Batter
<Option VALUE=\"Blueberry\">Vanilla/Blueberry
<Option VALUE=\"Caramel\">Caramel Swirl
<Option VALUE=\"Other\">Other...
</select><br>
<input type=\"submit\" name=\"send\" value=\"test\">
</form>
  ";

}else{

    ///count array
 $num = count($select);

file://loop through array
 for($i = 0;$i <$num;$i++){
  print $select[$i] . "<br>";
 }
}
?>
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: PHP list <[EMAIL PROTECTED]>
Sent: Tuesday, January 23, 2001 11:42 AM
Subject: [PHP] multple select forms... going to hit my head against a wall
..


> Hi all
>
> I'm having a slight little problem .. I can't seem to solve..
>
> I have a multiple select form .. that i select mutiple options from and
then it creates a variable called $select
> now if I display $select .. I only get the last selected value .. here
foloows test code..
>
> <?
> if ($select==""){
>   print"
> <form method=\"post\" name=\"select\" action=\"test.php3\">
> <SELECT MULTIPLE NAME=\"select\">
> <Option VALUE=\"Chocolate\">Chocolate/Chocolate Chip
> <Option VALUE=\"Peanut\">Peanut Brittle/Vanilla
> <Option Selected VALUE=\"Cookie\">Cookie Batter
> <Option VALUE=\"Blueberry\">Vanilla/Blueberry
> <Option VALUE=\"Caramel\">Caramel Swirl
> <Option VALUE=\"Other\">Other...
> </select><br>
> <input type=\"submit\" name=\"send\" value=\"test\">
> </form>
>   ";
>
> }else{
>
>   print $select;
>
> }
> ?>
>
> I'm de missing something ... can sombody please lend a hand .. thanks
>
> Henti Smith
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to