Quantcast
Channel: PHP array from checkbox values returns only Array instead of values - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Marc B for PHP array from checkbox values returns only Array instead of values

$
0
0

Given your name="cb1[]", your $_POST value will simply be $_POST['cb1'], which happens to be an array:

foreach($_POST['cb1'] as $key => $value) {   echo $value; // spit out a name   echo $_POST['cb1'][$key]; // same thing, in a different way}

Plus, as written, your query is vulnerable to SQL injection attacks.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>