Last Updated: February 25, 2016
·
966
· marlonlandaverde

Sending POST AJAX data to PHP. Where does it go?

In building an AJAX application with a PHP Backend, I had the hardest time figuring out where the data that I was sending was ending up and how could I access it in PHP. For the world to know, here's where it goes:

$_REQUEST['data'] = $_POST['data'] = {JSON data...woooo......};

This is assuming you JSON.stringify the data sent. If not, you might not receive any data.

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside