Form output to emailprophet.com mailing list

  • Profile Image
    InspiredMedia
    Asked on January 12, 2015 at 03:26 PM

    I have created a form - Maverick Tier3

    I have the output postdata from sample-data-post

    $postdata = $_POST;
        $email = $postdata[email];
        $cid = $postdata[cid];

     

    I want to fill in the fields on my api call with the email and cid values from above. I have included my script below:

    //Grab data posted from form
    $postdata = $_POST;
        $email = $postdata[email];
        $cid = $postdata[cid];
    //*Post data into Email Prophet//
    $xml='
      InspiredMedia
      850eda58468bd9aa71a042d3477ba810d618553a
      subscribers
      AddSubscriberToList
     

     


      '.$email.'
      48
      <add_to_autoresponders>true
      html
      yes
     

      12
      '.$cid.'


      19
      Tier3

     
     

     


    ';

    $ch = curl_init('http://www.emailprophet.com/iem/xml.php');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
    $result = @curl_exec($ch);


    if($result===false){
       echo"Error performing request";
    }
    else{
        $xml_doc=simplexml_load_string($result);
        echo'status is',$xml_doc->status,'
    ';
        if($xml_doc->status=='SUCCESS'){
            print_r($result);
        }else{
            echo'Error is',$xml_doc->errormessage,'
    ';
        }
    }
    die();

    ?>

  • Profile Image
    Mike
    Answered on January 12, 2015 at 03:50 PM

    Does this work as designed? I have submitted your Maverick_Tier3 form with example@example.com email, and I have received the success message from the script.

    Thank you.