At first here is my code:
HTML with Javascript:
function getValues(){
var filter;
$.ajax({
type: "POST",
url: "myphpfile.PHP?action=sek",
data: "id=1",
async: false,
success: function(ret){
filter = ret;
}
});
console.log(filter);
PHP myphpfile.php:
if(isset($_GET['action'])){
print myfunction($_GET['action'],$_GET['id']);
}
My problem: When I try to print the result out with console.log, the whole myphpfile.php is printed. As I know, that means that no values reached the HTML file. But Why?
The function "myfunction" have results, i have tried it first. This function returns an array. ( I can't show this function here)
I don't get it what i'm doing wrong, Please have a look, It drive me crazy.
Thanks in advance!