MODx POST data Handling in snippet
-
23-10-2019 - |
Question
I am new to Modx and I want to write a custom but of code in a snippet that handles incoming post data. Unfortunately I can't seem to be able to collect the post data using $_POST. Can anyone point me in the right direction please? Cheers John
Solution
Also, if you do not wish to cache the results of the snippet call use [[!getPost]] rather than [[getPost]].
OTHER TIPS
I've used
<?php
var_dump($_POST);
and [[getPost]]
and it worked (I got an array of 0, but I didn't send anything in post)
Vardump is a VERY bad idea.
The MODx Revolution Object is huge...
Please try:
<?php
print_r($_REQUEST);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow