I have a simple webform. I have specified the redirect URL to be the full URL to a servlet. The "Redirect POST Values" checkbox is set. When I submit the webform, it does indeed forward to the servlet. The post data in the http request, however, is empty. There simply are no elements in the parameter array. Am I missing something fundamental?

Thanks!

Comments

quicksketch’s picture

Seems to work for me, here's what I tried:

1) Create new php file called test.php in the root of my Drupal install
2) Pasted this code in:

POST:
<?php
print_r($_POST);
?>

3) Set the forward POST to http://localhost/test.php

Everything shows up fine. It may be that your servlet doesn't know how to understand multidimensional arrays, or that the POST was sent across domains, which I'm not certain would work.

harro’s picture

Following your instructions gave me an empty array (array() )... Maybe $_POST does not contain the values but they are stored in a different variable?

harro’s picture

Not sure why (what is the difference, only the HTML and BODY tags) but the following did print the $_POST array (and more):

<HTML><BODY>
$_SERVER:<BR>
<?php
print_r($_SERVER);
echo '<BR><BR>$_POST:<BR>';
print_r($_POST);
echo '<BR><BR>$_GET:<BR>';
print_r($_GET);
echo '<BR><BR>$_REQUEST:<BR>';
print_r($_REQUEST);
?>
</body></HTML>

Thanks for pointing me in the right direction, though!

Harro

quicksketch’s picture

Status: Active » Fixed

Awesome! I'll mark as fixed. Sounds like your browser might not display content without html tags (or similar).

Anonymous’s picture

Status: Fixed » Closed (fixed)
keesje’s picture

Status: Closed (fixed) » Active

Sorry for changing to 'active', but I really believe this is a bug.

Look here:
http://drupal.org/node/139196

I'm not the only one.

Let me know if I'm wrong.

keesje’s picture

Status: Active » Closed (fixed)

Excuse, back to closed.

Beats me, I unchecked 'Redirect POST Values', saved, checked again, saved, and it's working now. Strange.

Nevermind. I will post if it happens again.