I get the error:
unexpected 'var_dump' (T_STRING)

Can anyone help please, I would like to post the data below to the url set at $url

error_reporting( E_ALL | E_STRICT );
ini_set('display_errors', 1);

$url = 'https://www.actionmedicalresearch.co.uk/interface/list.php';

//create array of data to be posted
$post_data['email'] = 'john@john.com';
$post_data['Mobile'] = '0999999818';
$post_data['FirstName'] = 'Johan';
$post_data['Surname'] = 'Bidders';
$post_data['Event'] = 'This is the event';
$post_data['EventRegistration'] = 'event Registration';
$post_data['Date'] = '14/07/17';
$post_data['City'] = 'Horham';
$post_data['Region'] = 'Sussex';
$post_data['Postcode'] = 'RH14';
$post_data['Mobile'] = '11111198';
$post_data['Age'] = '90';
//traverse array and prepare data for posting (key1=value1)
foreach ( $post_data as $key => $value) {
    $post_items[] = $key . '=' . $value;
}

//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);

$response = drupal_http_request($url, $post_data = array(), $method = 'POST', $data = NULL, $retry = 3, $timeout = 30.0)
var_dump($response);

Comments

Jaypan’s picture

Change this:

$response = drupal_http_request($url, $post_data = array(), $method = 'POST', $data = NULL, $retry = 3, $timeout = 30.0)
var_dump($response);

To this:

$response = drupal_http_request($url);

Checkout my Japan podcasts.