When using JSON content-type the $_POST
array will not populate (only with multi-part forms I believe)
Here is how I correct the issue:
$_POST = json_decode(file_get_contents("php://input"), true);
More Related Contents:
- Multiple inputs with same name through POST in php
- getting a checkbox array value from POST
- Print $_POST variable name along with value
- How to get a form input array into a PHP array
- How to read if a checkbox is checked in PHP?
- method=”post” enctype=”text/plain” are not compatible?
- HTML input arrays
- How to prevent form resubmission when page is refreshed (F5 / CTRL+R)
- Submitting a multidimensional array via POST with php
- POST an array from an HTML form without javascript [duplicate]
- Send value of submit button when form gets posted
- PHP: check if any posted vars are empty – form: all fields required
- PHP – Redirect and send data via POST
- PHP POST not working
- Posting multidimensional array with PHP and CURL
- Posting array from form
- PHP: Possible to automatically get all POSTed data?
- How get value for unchecked checkbox in checkbox elements when form posted?
- $_POST max array size
- Back button re-submit form data ($_POST)
- Prevent Back button from showing POST confirmation alert
- PHP $_POST not working? [duplicate]
- Forbidden Error When Submitting Simple PHP Form
- Simple form not sending data via _POST [duplicate]
- multi-dimensional array post from form
- Undefined index error PHP
- PHP, pass array through POST
- Can you re-populate file inputs after failed form submission with PHP or JavaScript?
- Sort multidimensional array by date column, then use other column values if dates are the same
- Alternate to array_column()