I am trying to pass variables from a webform page to its redirect URL, but am having no success. Can anyone point me to an example of how to specify a variable on the redirected page?

Comments

scafmac’s picture

Not that I have any experience with this, but are you trying to pass them as POST or GET variables? Have you tried checking to see if the field key is passed as a POST variable upon redirect?

quicksketch’s picture

Try making a new node with a PHP body. Set its content to:

Your submission:

<pre>
<?php
print_r($_POST);
?>
</pre>

Then set your redirect URL to the full URL (including http://) of the new node. Make sure the 'Redirect POST values' checkbox is selected under the Advanced webform settings.

apratt’s picture

This was extremely helpful but of course leads to the next question. As I'm redirecting the POST variables I still need to get them into the database.

Will calling the webform_client_form_submit function on my processing page achieve that?


webform_client_form_submit($form_id, $form_values)

Or am I missing something? In terms of processing the submission - could I be sending them to different places based on their responses by using the additional processing section? Then the information would be written by the submit.

quicksketch’s picture

Hmm, I've never seen this done before. It could work, but you'll need to pass in the POST array such as this:

webform_client_form_submit('webform_client_form_submit', $_POST);

I have no idea if this will work and it definitely raises some security concerns. Validation also will not function when using the redirect POST option. I haven't yet found a way to make webform process completely and then pass on the POST to another form, so if this works, please follow up on it.

quicksketch’s picture

Status: Active » Closed (fixed)

Closing after no activity.