I have the following jquery:
$.ajax({
type: "POST",
url: "getchoices.php",
dataType: 'json',
data: JSON.stringify({ "userName": "test1", "password" : "test2" })
});
With corresponding PHP:
<?php
$json = $_POST;
print_r($json);
?>
However my output for getchoices.php
is just Array ( )
I have implemented the solution below, with the correct output from the console, however the PHP is not displaying anything.