Page 1 of 1

how can i detect dynamic checkbox and radiobuttons value?

Posted: Tue Nov 07, 2006 6:42 pm
by lmh85
$_POST['chkMember[$key]']="on"

initially i was having $chkMember[$key]="on" in my coding and it works. But it won't work for my in my web hosting server. So, i tried the above mentioned code, it doesn't work. Is there any other way to get the values of my checkbox and radio buttons? they are created upon some validation. So, i put them in an array. anyone? help! :(

Posted: Tue Nov 07, 2006 6:48 pm
by John Cartwright

Code: Select all

$_POST['chkMember'][$key]
:?:

Posted: Tue Nov 07, 2006 6:50 pm
by timvw
Originally you were assuming that register_globals was on... Anyway, the following should give you access to the same variable:

Code: Select all

$_POST[$chkMember[$key]];

Posted: Wed Nov 08, 2006 6:10 pm
by lmh85
how do i get my globals to be on?

Posted: Thu Nov 09, 2006 12:09 am
by feyd
lmh85 wrote:how do i get my globals to be on?
Our suggestion: don't even try. They create bad habits and aren't even supported in newer versions of PHP.