- Forums
- PHP
- PHP Error Automatically populating $HTTP_RAW_POST_DATA is deprecated
this page will give your instructions on how you can solve an error on your php code when you execute a php script and the error says: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warnin [4619], Last Updated: Mon Jun 24, 2024
Mon Dec 19, 2016
0 Comments
2398 Visits
$HTTP_RAW_POST_DATA is deprecated
Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in
Unknown on line
0
I got this error today, so the way i was able to fix it is with the following code:
if(!$_GET = file_get_contents("php://input"))die(';('); // get the $_POST data, this will be in json format
$_GET = json_decode($_GET, true); // make post data from json to array
as you can see, you will need to use json_decode to get the data
The Solution:
all you need to do is make sure you are sending 'a' with GET method like this: $_GET['a']