View difference between Paste ID: bhnQZiSH and w14eB23p
SHOW: | | - or go back to the newest paste.
1
function mymodule_form_alter(&$form, &$form_state, $form_id) {
2
	$form['actions']['submit']['#submit'][]='mymodule_submit';
3
}
4
5
function mymodule_submit($form, &$form_state)
6
{
7
	// Prepare vals
8
	$vals = $form_state['input']['submitted'];
9
10
	// Submit!
11
	$return = drupal_http_request('http://www.foreigndomain.com/?'.http_build_query($vals));
12
	if (strrpos(strip_tags($return->data),'Lead Received') !== false) {
13
		drupal_set_message(t('Information successfully sent.'));
14
	} else {
15
		form_set_error('form', strip_tags($return->data));
16
		$form_state['redirect'] = FALSE;
17
	}
18
}