ssage-
From: ioannes [mailto:[EMAIL PROTECTED]
Sent: Friday, 29 August 2008 1:22 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: Variable name as a string
In writing the script, though, there are two points. I don't always use
checkboxes, sometimes I just want to update all the reco
In writing the script, though, there are two points. I don't always use
checkboxes, sometimes I just want to update all the records on the
form. Eg I have a series of images and related text each with their ID
in the database table, on clicking update all the form elements get
submitted and I
, one
the parameter - so it makes sense (sort of) to use two different terms.
Simcha Younger
-Original Message-
From: tedd [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 28, 2008 4:40 PM
To: php-general@lists.php.net
Subject: RE: [PHP] Re: Variable name as a string
At 11:50 AM +0100 8
At 11:50 AM +0100 8/28/08, Ford, Mike wrote:
On 28 August 2008 00:04, tedd advised:
> One of the ways to get around this is to:
>
That way php will use "name" and javascript will use "id".
Why???
checkboxes = document.my_form["my_checkboxes[]"];
Cheers!
Mike
On 28 August 2008 00:04, tedd advised:
> At 12:07 AM +0200 8/28/08, Maciek Sokolewicz wrote:
>> 1
>> 1
>> 1
>> 1
>>
>> $my_checked_checkboxes = $_REQUEST['my_checkboxes']; // whichever
>> you wish, $_GET or $_POST, I don't care right now; you choose.
>
> Yeah, I remember that -- but a bit d
On 28 August 2008 04:26, Micah Gersten advised:
> You cannot have anything in the brackets for the name in a checkbox
> group. The brackets specify that it is an array. The name
> of the array
> is the key in $_POST that contains the values of the checkbox group
that
> were checked. You can hav
More specifically:
option 1 - colour:
# red
#
green
#
blue
colour: $colour\n";
?>
--
Ross McKay, Toronto, NSW Australia
"If ye cannae see the bottom, dinnae complain if ye droon"
- The Wee Book of Calvin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.
On Wed, 27 Aug 2008 22:25:44 -0500, Micah Gersten wrote:
>You cannot have anything in the brackets for the name in a checkbox
>group. [...]
Bollocks.
option 1 - colour:
option 2 - flavour:
option 3 - size:
colour: $colour\n";
$flavour = $_POST['options']['flavour'];
echo
Micah Gersten wrote:
You cannot have anything in the brackets for the name in a checkbox
group. The brackets specify that it is an array. The name of the array
is the key in $_POST that contains the values of the checkbox group that
were checked. You can have as many groups as you like.
Eh?
You cannot have anything in the brackets for the name in a checkbox
group. The brackets specify that it is an array. The name of the array
is the key in $_POST that contains the values of the checkbox group that
were checked. You can have as many groups as you like.
Thank you,
Micah Gersten
onS
tedd wrote:
At 1:58 PM -0500 8/27/08, Shawn McKenzie wrote:
ioannes wrote:
Actually, you are right, as you just put the checkbox index in the
POST and get the value from there. So you just need the number of
checkboxes...sorry.
for ($i = 1; $i <= 4; $i++)
{
$a = 'a' . $i;
$b = 'wha
At 12:07 AM +0200 8/28/08, Maciek Sokolewicz wrote:
tedd wrote:
At 1:58 PM -0500 8/27/08, Shawn McKenzie wrote:
ioannes wrote:
Actually, you are right, as you just put the checkbox index in
the POST and get the value from there. So you just need the
number of checkboxes...sorry.
for ($i =
First, the type is checkbox, not check. Second, you cannot put a value
in the brackets for a checkbox group. A checkbox group is passed to
PHP automatically as an array.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Maciek Sokolewicz wrote:
> Well, this
tedd wrote:
At 1:58 PM -0500 8/27/08, Shawn McKenzie wrote:
ioannes wrote:
Actually, you are right, as you just put the checkbox index in the
POST and get the value from there. So you just need the number of
checkboxes...sorry.
for ($i = 1; $i <= 4; $i++)
{
$a = 'a' . $i;
$b = 'wha
At 1:58 PM -0500 8/27/08, Shawn McKenzie wrote:
ioannes wrote:
Actually, you are right, as you just put the checkbox index in the
POST and get the value from there. So you just need the number of
checkboxes...sorry.
for ($i = 1; $i <= 4; $i++)
{
$a = 'a' . $i;
$b = 'whatever' . $i;
ioannes wrote:
Actually, you are right, as you just put the checkbox index in the POST
and get the value from there. So you just need the number of
checkboxes...sorry.
ioannes wrote:
Yes, Tedd, this does however incur the overhead of find out what i is,
because it could be a range of IDs fro
Actually, you are right, as you just put the checkbox index in the POST
and get the value from there. So you just need the number of
checkboxes...sorry.
ioannes wrote:
Yes, Tedd, this does however incur the overhead of find out what i is,
because it could be a range of IDs from the database,
At 7:08 PM +0100 8/27/08, ioannes wrote:
Yes, Tedd, this does however incur the overhead of find out what i
is, because it could be a range of IDs from the database, not
necessarily a count of the checkboxes on the page:
"
for ($i = 1; $i <= 4; $i++)
{
$a = 'a' . $i;
$b = 'whatever' .
Yes, Tedd, this does however incur the overhead of find out what i is,
because it could be a range of IDs from the database, not necessarily a
count of the checkboxes on the page:
"
for ($i = 1; $i <= 4; $i++)
{
$a = 'a' . $i;
$b = 'whatever' . $i;
if($_POST[$a] == 'on')
{
At 4:55 PM +0100 8/27/08, JOHN DILLON wrote:
Perhaps this example may help. Eg: a form with checkboxes and
submit button, a few are checked and I want to delete the
corresponding records from the database. The database table has an
ID column:
for each ($argv as $key=>$value) {
//$key is
Perhaps this example may help. Eg: a form with checkboxes and submit
button, a few are checked and I want to delete the corresponding records
from the database. The database table has an ID column:
for each ($argv as $key=>$value) {
//$key is named cb_1 $value is "checked"
//to get 1 fr
21 matches
Mail list logo