I need to send more than one variable via ajax / php, I did some unsuccessful tests, how should I proceed?
PHP (this works but I can not insert another variable)
$("#colPasta").focus(function(){
var val = new Array();
$('.check:checked').each(function(){
val.push($(this).val());
});
$.ajax({
url:'colPasta.php',
type:'GET',
data:'col=<?php print $colar; ?>',
success:function(data){
$('.exibeColPasta').html(data);
}
});
return false;
});
I've tried using the following PHP command without success.
data:{ 'col'= <?php echo $colar; ?>, 'ovo'= <?php echo $ovo; ?>},
I'm waiting for you.