I refer to this page: http://stackoverflow.com/questions/1557273/jquery-post-array-of-multiple-checkbox-values-to-php
<input type="checkbox" class="box" value="blue" title="A" />
<input type="checkbox" class="box" value="red" title="B" />
<input type="checkbox" class="box" value="white" title="C"/>
$('#include').click(function(){
var val = $('.box:checked').map(function(i,n) {
return $(n).val();
}).get(); //get converts it to an array
var title = $('.box:checked').map(function(i,n) {
return $(n).attr('title');
}).get(); //get converts it to an array
$.post(url, {'val[]': val,'title[]':title}, function(response) {
alert('scuess');
});
return false;
})
---------------------------------------------
<?php
foreach($_GET['val'] as $numA)
{
foreach($_GET['title'] as $numB)
{
$str="insert into user_photos (val,title) values ('$numA','$numB')";
mysql_query($str,$link);
}
}
?>
Please tell me how to do that...