We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40540
    • 1 Posts
    Hi,

    I'm triyng to build a facebook page tab with MODX. Facebook integrates custom tabs into an iframe and sends JSON string as a POST request to the application.

    The problem is that when I print_r($_POST) the variable seems to be empty. Maybe this is some security issue, I don't know, but it's vital for my application to receive the POST variables.

    Have someone had such kind of problem?

    I need to fix this urgent, because there will be an ad campaign in a fiew hour promoting this application...
      • 33968
      • 863 Posts
      There's not really much info to go on here - try using Chrome Dev Tools to check exactly what is being POSTed, and where to. That will at least get you started in debugging.
        • 3749
        • 24,544 Posts
        Are you seeing this when you try it?

        array()


        If not the print_r() is not working.

        If it's a snippet, try this:

        return print_r($_POST,true);



        ------------------------------------------------------------------------------------------
        PLEASE, PLEASE specify the version of MODX you are using.
        MODX info for everyone: http://bobsguides.com/modx.html
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 46281
          • 1 Posts
          I have the same problem.
          $_POST
          is an empty array. But
          file_get_contents('php://input')
          returns what I POSTed. Can any one shed some light on what I missed? thx a lot in advance. [ed. note: zhijunsheng last edited this post 12 years, 8 months ago.]