Using drupal_http_post() to submit to external site: What am I doing wrong?
Thank you everyone for the pointers.

I realized that my custom module that uses the webform module to submit to an external url (via drupal_http_request) had to be written as two separate functions: one using hook_form_alter and one using a custom submit handler. The code is as follows.

&lt;?php

function webform_to_data_repo_form_alter(&amp;$form, &amp;$form_state, $form_id) {

//I only want form 765 to submit externally //
if ($form_id == 'webform_client_form_765') {
$form['#submit'][] = 'my_additional_submit_handler';
 }
}

function my_additional_submit_handler(&amp;$form, &amp;$form_state) {

$url = 'your.external.url.here'
$headers = array('Content-Type' =&gt; 'application/x-www-form-urlencoded',);
$response = drupal_http_request($url, $headers, 'POST', http_build_query($form_state['values'], '', '&amp;'));

}




?&gt;


As a side note, I never got to test the result of using dpm($response) using the Devel module as beth suggested.

I'm using a webform (via the webform module) to test. What I wanted to happen are two things.


The webform validates the submission which in turn would keep a log of the submission through Drupal (webform module by default and by design).
Simultaneously submit inputs from #1 to external url.


For the longest time, only #1 is happening and I can't seem to make Devel look into $response because that variable only exists when there's an attempt on submission. How does one make Devel module load when a successful submission has been made through a Webform? I guess this is another question for another time.