I don't know nothing about PHP and required me to call from PHP an ASP.Net MVC page to integrate on the PHP page.
I thought using a ajax call will work and be easier to implement. But it seems not to work.
My code:
<div class="pageContainer">
<?php
echo 'start debugging';
$param1=$_GET['param1'];
$param2=$_GET['param2'];
$htmlPage = '';
$parameters = {
myParam1: $param1,
myParam2: $param2
};
try {
$.ajax({
type: 'POST',
url: 'http://localhost:8080/MyController/MyAction',
data: $parameters,
contentType: 'application/json; charset=utf-8',
dataType: 'json',
processdata: true,
success: function(result){
try {
$htmlPage = result->HtmlReturned;
}
catch (er) {
alert('Error');
return false;
}
},
async: true,
crossDomain: false,
error: function(er){ alert('Error'); }
});
} catch (e) {
echo 'catch';
alert('Error');
}
echo $htmlPage;
?>
</div>
What is wrong? I can't usu AJAX calls? I don't get any error and I can't even debug so I don't know what is wrong. My page simply be all empty, without headers without nothing.
The PHP project isn't mine so I can't include any extension or something like that.