Hey Bob,
thanks for your response...
I "gave up" on CURL - I need to read some tutorials
🙂I DID however get it to work in a regular Chronoform.
1. Downloaded the listsubscribe API code
2. put my APIkey in the config.inc.php
3. Here's the code - in the On Submit Code - after sending email box:
$email = $_POST[text_1];
$fname = $_POST[text_2];
$interest = $_POST[radio0];
require_once 'inc/MCAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey and ListID
$api = new MCAPI($apikey);
$merge_vars = array(FNAME=>$fname, LNAME=>'', INTERESTS=>$interest);
$retval = $api->listSubscribe( $listId, $email, $merge_vars );
if ($api->errorCode){
//echo "Unable to load listSubscribe()!\n";
//echo "\tCode=".$api->errorCode."\n";
//echo "\tMsg=".$api->errorMessage."\n";
} else {
//echo "Returned: ".$retval."\n";
}
The key was removing the apostrophes from the array declaration around FNAME etc. In the "official" API docs, the $merge_vars was:
$merge_vars = array('FNAME'=>$fname, 'LNAME'=>'', 'INTERESTS'=>$interest);
and that constantly created the error.
Hopefully - this might help others with the MailChimp integration...
Rod