HELP, adding subscriber details to campaign monitor via php.

hi there.

I have a customer website that I would like to add a custom sign up form to, the sign up form has extra details that the customer can select, e.g., what interests do they like.  these are set up as check boxes.

now usually, I would copy the code from the campaign monitor and insert it into the website, so that when submitted, it would post directly the createandsend.com.

however - because the customer has requested a captcha form (using recaptcha) - I have to first post to a PHP page that checks the details of the captcha form.

if the form is correct, I then need to post onto createandsend to submit the information of the subscriber.

I am posting to the correct url with the various parameters of the form, with their associated values.  The name and email address of the subscriber works fine, however when it comes to the checkbox code, no matter how I format the data in the posting url - they will not save.  I am not sure how the campaign monitor extracts the data from a form submission, so cannot format the data in the same way.

please see the code below for examples.

FIRST OFF - THE FORM.

                <form action="verify.php" method="post" id="family-signup-form"> 

                <div><fieldset><legend>Your Details</legend>
                
                <div class="form-item" id="edit-firstname-wrapper"> 
                 <label for="edit-firstname">Name: <span class="form-required" title="This field is required.">*</span></label> 
                 <input type="text" name="cm-name" id="name" value="<?php echo $_GET['name'] ?>" />
                </div> 
                <div class="form-item" id="edit-email-wrapper"> 
                 <label for="edit-email">Email: <span class="form-required" title="This field is required.">*</span></label> 
                 <input type="text" name="cm-ajyiti-ajyiti" id="ajyiti-ajyiti" value="<?php echo $_GET['email'] ?>"/> 
                </div> 
                <div class="form-item" id="edit-email2-wrapper"> 
                 <label for="edit-email2"><b>Interested In:</b><br/><br/></label> 
                
                 
                </div> 
                <div class="form-item" id="edit-email2-wrapper"> 

                <input type="checkbox" name="cm-fo-nhyktr" id="cm2147963" value="2147963" <?php if ($_GET['cm-fo-nhyktr'] == "2147963") {echo "checked";}?>/> <label for="cm2147963">Family Discounts</label><br />
                <input type="checkbox" name="cm-fo-nhykty" id="cm2147964" value="2147964" <?php if ($_GET['cm-fo-nhykty'] == "2147964") {echo "checked";}?>/> <label for="cm2147964">Daily Deals</label><br />
                <input type="checkbox" name="cm-fo-nhyktj" id="cm2147965" value="2147965" <?php if ($_GET['cm-fo-nhyktj'] == "2147965") {echo "checked";}?>/> <label for="cm2147965">Corporate Packages</label><br />
                <input type="checkbox" name="cm-fo-nhyktt" id="cm2147966" value="2147966" <?php if ($_GET['cm-fo-nhyktt'] == "2147966") {echo "checked";}?>/> <label for="cm2147966">Special Offers and Events</label><br />
                 

                 
                 
                </div>

AND SECONDLY, THE PHP WHICH SENDS TO CM IF CORRECT

 

<?php
  
  $Name = Trim(stripslashes($_POST['cm-name'])); 
  $Email = Trim(stripslashes($_POST['cm-ajyiti-ajyiti'])); 
  
  $FamDiscounts = Trim(stripslashes($_POST['cm-fo-nhyktr'])); 
  $DailyDeals = Trim(stripslashes($_POST['cm-fo-nhykty'])); 
  $CorpPackages = Trim(stripslashes($_POST['cm-fo-nhyktj'])); 
  $SpecialOffers = Trim(stripslashes($_POST['cm-fo-nhyktt']));
  
   
     
  require_once('recaptchalib.php');
  $privatekey = "xxxxxxx";
  $resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);

  if (!$resp->is_valid) {
    // What happens when the CAPTCHA was entered incorrectly
    print "<meta http-equiv=\"refresh\" content=\"0;URL=index.php?status=error&?name=".$Name."&email=".$Email."&cm-fo-nhyktr=".$FamDiscounts."&cm-fo-nhykty=".$DailyDeals."&cm-fo-nhyktj=".$CorpPackages."&cm-fo-nhyktt=".$SpecialOffers."\">";
  } else {
    
        echo "<meta http-equiv=\"refresh\" content=\"0;URL=  http://thefreshlab.createsend.com/t/r/s/ajyiti/?cm-name= ".$Name."&cm-ajyiti-ajyiti=".$Email."&cm-fo-nhyktr=".$FamDiscounts."&cm-fo-nhykty=".$DailyDeals."&cm-fo-nhyktj=".$CorpPackages."&cm-fo-nhyktt=".$SpecialOffers."\">";
  

  


  }
  ?>

PLEASE HELP.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098