I saw this link:Webform - Submit values from Drupal 7 from to external url

I have this problem too (sending parameters to external url and redirect to that url simultaneously)!

But I also want to redirect user, who submit the parameters to url, redirect to that url simultaneously!

my Code is:

function Chargingform_nameform() {
    $xml = 'PHP Handbook30000130000This is good book.MySQL Handbook25000250000This is a good book too.';
    // Get sing
    $sign ='ewtnXYRWPSalHhna9hgO+Kc0W9Z8JBUeG1FkcKPvZL5w2s588c0/B9rTki/Ry4vHuNG7uuPcttTAz/3j4e/5GcZ4L40jNyzK7dkQyEalRVOZNe9gdnSXMH7h8Q6OY5vwLENn7S4MGTMZCABRrmj1W9vviykftP4tv0EDtNkUgjU';   
    $form['xml'] = array(
        '#title' => t('xml'),
        '#type' =>'hidden',
    $form['sign'] = array(
        '#title' => t('sign'),
        '#type' =>'hidden',
     variable_set('xml_hidden', $xml);
     variable_set('sign_hidden', $sign);    
 $form['submit'] = array(
        '#type' => 'submit',
        '#value' => t('submit'),
    return $form;

function Chargingform_nameform_submit($form, &$form_state) {  
$options = array();   
     $options = array(
        'method' => 'POST',       
        'xml' => $form_state['values']['xml'],
        'sign' => $form_state['values']['sign'],            
    $url = 'https//:url';    
    $response = drupal_http_request($url, $options);     

How should I solve this issue?

  • The code in the answer you linked to explains it, it should also direct the user to the external page. Please explain your problem a little better.
    – 2pha
    Sep 19, 2014 at 17:24
  • possible duplicate of Form #redirect not working?
    – beth
    Sep 19, 2014 at 18:26


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.