checkbox arrays

Associate
Joined
19 Jul 2006
Posts
1,847
using this code in a form
PHP:
 <input type="checkbox" id="area[]" value="SRF" /> SRF
  <input type="checkbox" id="area[]" value="eSafety" /> eSafety
  <input type="checkbox" id="area[]" value="Projects" /> Projects

and this to try to get info out the other end
PHP:
$area=serialize($_POST['area']);
echo $area;

but that just returns N;

what am i doing wrong

TIA
 
calling the checkboxes "area[]" is the same as calling them all "area" the "[]" does not make it into an array.
You will have to give each box it's own name and pick them up individually with a $_POST for each one.

Edit: Ignore this :p
 
Last edited:
how would i make it into an array as when i want to enter the information into a database the values need to go into one feild
 
Back
Top Bottom