1
votes

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

3
can you show what you've tried? I recall vardumping the post working for me in a snippet.Daniel
Hi Daniel - sorry for delay my computer was boken. I simply tried as you say var_dumping the post array but it just showed it as empty. I am using revoultion if this makes a differenceuser505988

3 Answers

1
votes

Also, if you do not wish to cache the results of the snippet call use [[!getPost]] rather than [[getPost]].

0
votes

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)

0
votes

Vardump is a VERY bad idea.

The MODx Revolution Object is huge...

Please try:

<?php
print_r($_REQUEST);