I have this code:
var name= "theName";
var surname= $('#surname').val();
$.ajax({
url: 'SaveEdit.php',
type: 'post',
data: { "callFunc1": whichOne},
success: function(response) {
alert(response);
}
});
It's working, but i need to do something like this:
var name= "theName";
var surname= $('#surname').val();
$.ajax({
url: 'SaveEdit.php',
type: 'post',
data: { "callFunc1": whichOne, name},
success: function(response) {
alert(response);
}
});
It gives me errors like:
Warning: missing argument 2 for func1()
I am using this code too:
function func1($data, $name){
//some code here
}
if (isset($_POST['callFunc1'])) {
echo func1($_POST['callFunc1']);
}
How to do it right?