Reputation: 23
I have a simple php code as follow:
<?
print_r($_POST);
?>
This worked for non-SSL domain before I have done SSL. But it doesn't work after I have done SSL.
After SSL done, it works with https://
well, however, I like to use old http://
call which was working well also.
Because I already published the webapp using the http://
call, and can't modify the API call parts.
Any help?
In Addition, I test the API in postman with POST option, it works with only https://example.com/api.php, but doesn't work with http://example.com/api.php and it just returns empty array value.
Upvotes: 1
Views: 155
Reputation: 46
$_POST
is an array of post values, it shouldn't work on https
or http
either, PHP will return this message
Notice: Array to string conversion
To solve this problem you should use :
foreach ($_POST as $value) {
echo $value;
}
Upvotes: 2