I have this code that loads a file called mailchimp-api and signs a user up to a newsletter:
<?php
if(isset($_POST['email'])){
$email = $_POST['email'];
include("mailchimp-api.php");
$chimp = new MailChimp('XXXXXXXXXX-us7');
echo "API registered";
$chimp = $MailChimp->call('lists/subscribe', array(
'id' => 'XXXXXXXXX',
'email' => $email,
'double_optin' => false,
'update_existing' => true,
'send_welcome' => true,
));
echo "values set";
if( $result === false ) {
$error = "There was an error signing you up! Please try again";
}
elseif( isset($result->status) && $result->status == 'error' ) {
// Error info: $result->status, $result->code, $result->name, $result->error
$error = $result->error;
}
}
?>
The code fails at the $chimp = $MailChimp->call
line, as shown by the debug echos. Why is this? phpcurl is definitley installed!