title: Not able to get sent JSON data in WordPresss page
body: <p>Our website is on WordPress, I had converted all the HTML pages into custom WordPress pages using a custom WordPress template.
  I have uploaded one js file in the header and that js file has the below code on button image click.
  When the user clicked on the button image from the WordPress page, it will get the data into &quot;stringifyPayloadData&quot; and this data is coming from the js session. And I want to send this data on the same page (from where we clicked) because I want those data in PHP variable so that I can do other PHP functionality by using this JSON data.</p>
  <pre><code>$.ajax({
                     type: &quot;POST&quot;,
                     dataType: &quot;json&quot;,
                     url: &quot;http://localhost/nexplanontraining/request-clinical-training/in-person-training/training-registration-review/&quot;,
                     data: stringifyPayloadData,
                     //contentType: &quot;application/json&quot;,
                     success: function(data){
                         alert(&quot;Data Sent&quot;);
                     },
                     error: function(e){
                         console.log(e.message);
                     }
                 });
  </code></pre>
  <p>And below is my php code to get data into the same page, but it's not working.</p>
  <pre><code>echo json_encode($_POST);
  $jsonString = file_get_contents(&quot;php://input&quot;);
  echo $jsonString;
  $phpObject = json_decode($jsonString);
  echo $phpObject;
  </code></pre>
  <p>I have a button image on the same page where I want that session data into PHP variable on click event that's why I use AJAX request on click. and try to send data to the same page by giving the URL of the page. I got a &quot;Data Sent&quot; alert but did not get data into the WordPress page. Is there any other way to get data on the WordPress page?</p>