I'm trying to send post request with ajax but it doesn't work and I'm so lost. Please I need some help...
index.php:
<button type="button" id="ajaxBtn">Test</button>
main.js:
$('#ajaxBtn').click(function() {
$.ajax({
url: test.php,
type: "POST",
data: {any : "any"},
success: function() {
window.location.href = "./test.php";
}
});
});
When I click on the button I'm redirected to test.php but:
var_dump($_POST) // array(0) { }
PS: I don't want to use GET method.
Thanks for help guys.