trante
trante

Reputation: 34006

Drupal webform, how can i make a form that triggers a php script with GET arguments?

I want to create a form in Drupal 7. User will select appropriate listbox, radio button options. When user clicks Submit button, form will post related values to another php file with GET arguments.

For two days I tried Webform module to do this. I would be happy if you can recommend me some way to make this? Examples, tryouts, modules, codes, etc

Upvotes: 1

Views: 2254

Answers (1)

Clive
Clive

Reputation: 36955

There are 'better' ways but this will do the trick in a custom module:

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  $nid = 1; // Or whatever the node ID of your webform is
  if ($form_id == 'webform_client_form_' . $nid) {
    $form['#action'] = 'my-script.php';
    $form['#method'] = 'get';
  }
}

Bear in mind of course that the original webform submission functions will not run so your webform data won't be saved to the database.

Upvotes: 2

Related Questions