hi there I have form like this:
<form id="form">
<input type="text" name="fname" />
<input type='checkbox' name='ck[]' value='1'id='ck_1' />
<input type='checkbox' name='ck[]' value='2'id='ck_2' />
<input type='checkbox' name='ck[]' value='3'id='ck_3' />
<button id="btn">send</button>
</form>
I send this form these method via JQuery.
$('body').on('click','#btn',function(event)
{
event.preventDefault();
$.ajax({
type: "POST",
url: "index.php",
data: $("#form").serialize(),
success: function(data)
{
alert('data sent.');
}
...
now how can I print all post?
I try this:
foreach ($_POST as $key => $value)
echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
but it not works for multi select checkbox...
how can I access checkbox values in server?