Im trying to create a snippet that will read $_POST data but print_r($_POST) returns array() but if i do print_r(file_get_contents('php://input')) it returns the data that im posting any suggestions on this?
so, how looks your form, how your snippet-code and how do you call that snippet?
Anything else on that resource, where you have that snippet?
a snippet must never do echo or print, but must return
if you want to debug
return json_encode($_POST);
FerX - Developer at Eracom s.r.l.
I do this:
return '<pre>' . print_r($_POST, true) . '</pre>';
The true argument is necessary, because otherwise print_r()'s output will go to stdout rather than being returned.