mardi 20 décembre 2016

Get data from multiple checkboxes and insert into mysql php

I am trying to get data from multiple checkboxes and insert into mysql. The data is inserting alright, but instead of inserting the correct value, it inserts value 'on'.

Here are my codes

<input type="checkbox" name="product[]" value="product11"> Product 11

<input type="checkbox" name="product[]" value="product12"> Product 12

<input type="checkbox" name="product[]" value="product13"> Product 13

<input type="checkbox" name="product[]" value="product14"> Product 14

<input type="checkbox" name="product[]" value="product15"> Product 15

<input type="checkbox" name="product[]" value="product16"> Product 16

I get this via php this way

$products = implode(',',$_POST['product']);




Aucun commentaire:

Enregistrer un commentaire