What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Form output to emailprophet.com mailing list

    Asked by InspiredMedia 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();

    ?>

    post data emailprophet.com
  • Profile Image
    JotForm Support

    Answered by Mike 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.