0

I'm trying to get the POST data from my form the problem I'm having is it only displays the last make item submitted? What am I doing wrong? I have tried serval things to get it to work and all with no luck!

Refine.php

   sort($make);
   foreach($make as $key => $value):
       if($value != '')
      {
        echo '
          <label>
      <input type="checkbox" name="make" value="'.$value.'" id="'.$value.'">
            '.ucfirst(strtolower($value)).'</label>
          <br>';
       }
    endforeach;

Browse.php

foreach($_POST['make'] as $item){
echo $item;

}
Kelly Hansen
  • 69
  • 10

1 Answers1

2

kotapeter nailed it!

sort($make);
   foreach($make as $key => $value):
       if($value != '')
      {
        echo '
          <label>
      <input type="checkbox" name="make[]" value="'.$value.'" id="'.$value.'">
            '.ucfirst(strtolower($value)).'</label>
          <br>';
       }
    endforeach;
Kelly Hansen
  • 69
  • 10