Re: [PHP] multiple checkbox help

2004-05-31 Thread John W. Holmes
Bob Lockie wrote:
I tried this HTML:


$_REQUEST['deleteID'] === the last box checked.
so I did a google search and changed my HTML to:


Now the code:
for ($i = 0; $i < count($_REQUEST['deleteID']); $i++){
echo "deleting '" . $value . "'";
}
has the right count but how do I get the values out?
$_POST['deleteID'][0] will be the first checked checkbox value, 
$_POST['deleteID'][1] will be the second, etc. count($_POST['deleteID']) 
will tell you how many were checked, implode(',',$_POST['deleteID']) 
will give you a comma separated list, etc, etc...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] R: [PHP] multiple checkbox help

2004-05-31 Thread Alessandro Vitale
I usually use this approach:


.
.


---

foreach($_REQUEST['myName'] as $id => $value)
{
   if($value == "CHECKED")
 array_push($idArray, $id);
}

if something is not clear, let me know

cheers,

A.


-Messaggio originale-
Da: Bob Lockie [mailto:[EMAIL PROTECTED]
Inviato: lunedi 31 maggio 2004 16.51
A: php-general Mailing List
Oggetto: [PHP] multiple checkbox help


I tried this HTML:



$_REQUEST['deleteID'] === the last box checked.
so I did a google search and changed my HTML to:




Now the code:
for ($i = 0; $i < count($_REQUEST['deleteID']); $i++){
 echo "deleting '" . $value . "'";
}
has the right count but how do I get the values out?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] multiple checkbox help

2004-05-31 Thread Bob Lockie
Thanks to all those who responded.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] multiple checkbox help

2004-05-31 Thread Daniel Clark
Change $_REQUEST to $_POST (a little more secure).

foreach( $deleteID as $key => $value) {
 
echo 'deleting ' . $value . '' ;
}


>>I tried this HTML:
>>
>>
>>
>>$_REQUEST['deleteID'] === the last box checked.
>>so I did a google search and changed my HTML to:
>>
>>
>>
>>
>>Now the code:
>>for ($i = 0; $i < count($_REQUEST['deleteID']); $i++){
>> echo "deleting '" . $value . "'";
>>}
>>has the right count but how do I get the values out?
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>




[PHP] multiple checkbox help

2004-05-31 Thread Bob Lockie
I tried this HTML:


$_REQUEST['deleteID'] === the last box checked.
so I did a google search and changed my HTML to:


Now the code:
for ($i = 0; $i < count($_REQUEST['deleteID']); $i++){
echo "deleting '" . $value . "'";
}
has the right count but how do I get the values out?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php