开发者

$_POST undefined from remote server POST

开发者 https://www.devze.com 2023-03-09 20:16 出处:网络
I am writing a Drupal 7 module which is listening for HTTP POST messages to be sent by a 3rd party remote application. For testing I am sending messages using the Firefox Poster extension.

I am writing a Drupal 7 module which is listening for HTTP POST messages to be sent by a 3rd party remote application. For testing I am sending messages using the Firefox Poster extension.

If I POST the message, the following code fails to place any value in my local vars (I get 'undefined index'):

$transId = urldecode($_POST['c2s_transaction_id']);

However, if I send the message using GET, the vars get populated fine with the following code:

$transId = urldecode($_REQUEST['c2s_transaction_id']);

This is true on both my local WAMP setup and on a shared hosting package.

I have never worked with HTTP POST messages before and have开发者_运维技巧 no idea where the problem might be. Could it be Drupal, the web server, or my code? Can anyone suggest how I might resolve this?

Many thanks,

Polly


Drupal removes the $_POST/$_GET in the system, just use $_REQUEST instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消