1
0
mirror of https://github.com/fspc/Yellow-Bike-Database.git synced 2025-02-22 08:53:23 -05:00

Improves the code to connector.

This commit is contained in:
Jonathan Rosenbaum 2015-02-28 06:36:36 +00:00
parent e51d5a1c89
commit 39def79d87

View File

@ -51,25 +51,31 @@ $ssl_certificate = SSL_CERTIFICATE;
// send data to connector (local or remote)
if (isset($_POST['email_list_connector'])) {
$json = array(
'password' => $email_list_connector_password,
'email' => $_POST['email'],
'first_name' => $_POST['first_name'],
'last_name' => $_POST['last_name'],
);
$ch = curl_init();
$curlConfig = array(
CURLOPT_URL => $email_list_connector . '/api/parsetime',
CURLOPT_URL => $email_list_connector,
CURLOPT_POST => true,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => array(
'password' => $email_list_connector_password,
),
CURLOPT_POSTFIELDS => json_encode($json),
);
if ($ssl_certificate) {
$curlConfig[CURLOPT_CAINFO] = $ssl_certificate;
}
}
curl_setopt_array($ch, $curlConfig);
$result = curl_exec($ch);
curl_close($ch);
// just to test
echo $result;
}