RE: Type of form element

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Is it possible to loop through all $_POST values to see if it 
> is a checkbox? 
> If so then for that element if it is equal to 'on' then 
> change it to 1 
> otherwise change it to 0?


foreach($_POST as $key => $value){
  if
($value=='on'){$_POST[$key]='1';}elseif($value=='off';){$_POST[$key]='0'};
}

JM

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux