http://php.net/FAQ.php
--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Hon-Chi Ng <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 12, 2001 6:42 PM
Subject: How to Retrieve All Selected Values of CheckBox Group in Form?
> Hi
>
> How I read the all values selected for checkboxes of same name that are
> submitted to HTML form?
>
> I tried to translate the example on CGI.pm homepage to PHP below.
>
> <FORM METHOD=POST>
> What's your name? <INPUT TYPE=TEXT NAME="name" VALUE="<?= $name ?>">
> <P>
> What's the combination?
> <P>
> <INPUT TYPE=CHECKBOX NAME="words" VALUE="eenie" CHECKED>eenie
> <INPUT TYPE=CHECKBOX NAME="words" VALUE="meenie">meenie
> <INPUT TYPE=CHECKBOX NAME="words" VALUE="minie" CHECKED>minie
> <INPUT TYPE=CHECKBOX NAME="words" VALUE="moe">moe
> <P>
> <P>
> <INPUT TYPE=SUBMIT>
> </FORM>
> <P>
> <HR>
> Your name is <EM><?= $name ?></EM>
> <P>
> The keywords are <EM><?php echo "$words" ?></EM>
> <P>
>
> Echoing the value of $words in PHP always display the last one only,
> regardless of the number of choices for "words" checkboxes have been
> selected.
>
> On the other hand, if param('words') is used with CGI.pm, it displays all
> the selections for "words" checkboxes.
>
>
> FYI, below are some of info displayed by the phpinfo().
>
> Version: 4.0.6
> System: SunOS 5.7
> Configure Command: './configure' '--with-apache=../apache_1.3.20'
'--enable-ftp' -- enable-versioning' --enable-track-vars'
> Server API: Apache
> Virtual Directory Support: disabled
> ZEND_DEBUG: disabled
> Thread Safety: disabled
>
>
> Thanks. I'm new to PHP, and any specific and detail explanations are
> appreciated.
>
> Regards
> Hon-Chi
>
>
> ------------------------------------------------------------
> --== Sent via Deja.com ==--
> http://www.deja.com/
--
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]