I have three different parts to my page. The first is a button, the second is a JS function (AJAX request) and the last one is a PHP script that is called by the AJAX request.
The PHP script is supposed to call a web service to process the data. Here is the content of the PHP script:
<?php
if(isset($_POST['forminfos'])){
$client = new SoapClient('URL');
$client->Function();
header('Location: localhost/page.php');
}
?>
The page is not redirected but when I check the console I can see that there is a GET with the localhost/page.php content.
//on button sumbit
var data=$('#forminfos').serializeArray();
$.ajax({
url: '../func.php',
data:data,
type: 'POST',
dataType: 'json',
success: function () {
},
error: function(){
}
});
I expected the page with the AJAX request to be redirected to 'localhost/page.php' but it is not.