title: Can not get MailChimp to save my data using the API with Curl
body: <p>I have tried and tried to send data to MailChimp using curl but cannot get the
  data to save in MailChimp. Any help with this would be greatly appreciated!</p>
  
  <p>Here is my code:</p>
  
  <pre class="lang-php prettyprint-override"><code>$mailChimpUrl = "http://us2.api.mailchimp.com/1.3/?method=listSubscribe";
  $merges = array(
      'FNAME'=&gt;'Dave', 
      'LNAME'=&gt;'Gilmour',
      'BUILDING'=&gt;'Central High School',
      'MMERGE17' =&gt; '35904',
      'MMERGE12'=&gt;'Yes'
  );
  
  $apikey="myrealapiishere-us2";
  $listId="myrealformidishere";
  $email="zz22@aol.com";
  $double_optin=true;
  $update_existing=false;
  $replace_interests=true;
  $send_welcome=false;
  $email_type = 'html';            
  $data = array(
      'email_address'=&gt;$email,
      'apikey'=&gt;$apikey,
      'merge_vars' =&gt; $merges,
      'id' =&gt; $listId,
      'double_optin' =&gt; $double_optin,
      'update_existing' =&gt; $update_existing,
      'replace_interests' =&gt; $replace_interests,
      'send_welcome' =&gt; $send_welcome,
      'email_type' =&gt; $email_type
  );
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $mailChimpUrl);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));      
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  $result = curl_exec($ch);
  curl_close($ch);
  </code></pre>