Welcome Guest, Not a member yet? Register   Sign In
working with checkboxes
#4

[eluser]black.Blank[/eluser]
is there any other way on how i can rewrite the following sample code?
Code:
if(in_array('sample1',$sample)
  $samp = 1;
  else if(!in_array('sample1',$sample)
  $samp = 0;

if(in_array('sample2',$sample)
  $samp2 = 1;
  else if(!in_array('sample2',$sample)
  $samp2 = 0;

if the checkbox is ticked, then the value for the corresponding field in the dbase will be 1 else 0.


Messages In This Thread
working with checkboxes - by El Forum - 01-05-2011, 12:35 AM
working with checkboxes - by El Forum - 01-05-2011, 01:09 AM
working with checkboxes - by El Forum - 01-05-2011, 03:04 AM
working with checkboxes - by El Forum - 01-05-2011, 03:27 AM
working with checkboxes - by El Forum - 01-05-2011, 03:35 AM
working with checkboxes - by El Forum - 01-05-2011, 03:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB