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

    Sending form data to Post Affiliate Pro using post method.

    Asked by customlogoshop on July 19, 2016 at 02:11 PM

    Hello

    I am trying to integrate jotform with post affiliate pro. Here is the guide to set it up to track sales on my thank you page which currently is https://www.customlogoshop.com/order-confirmation 

     

    Here is there guide http://addons.qualityunit.com/integration-methods/_ijotform/?_ga=1.259304650.1362644497.1468951599

     

    I have enabled post form data from https://www.customlogoshop.com/order-test-checkout

    It goes from https://www.customlogoshop.com/order-test > order-test-checkout > order-confirmation (thank you page)

     

    Here is the code I tried using which is pasted into confirmation page

     

    <?php /********* Post Affiliate Pro integration snippet *******/ if (isset($_POST['orderid'])) { ?> <script type="text/javascript"> document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" + (("https:" == document.location.protocol) ? "https://" : "http://") + "customlogoshop.postaffiliatepro.com/scripts/j13l9o%27 type=%27text/javascript%27%3E%3C/script%3E")); </script> <script type="text/javascript"> PostAffTracker.setAccountId('default1');var sale = PostAffTracker.createSale(); sale.setTotalCost('<?php echo $_POST['input50[2]']; ?>'); sale.setOrderID('<?php echo $_POST['orderid']; ?>'); sale.setProductID('<?php echo $_POST['formID']; ?>'); PostAffTracker.register(); </script> <?php } /******** Post Affiliate Pro integration snippet *******/ ?>



    and when I inspect my form after I have submitted the form here's what appears:

    script type="text/javascript">
      document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" +
      (("https:" == document.location.protocol) ? "https://" : "http://") +
      "customlogoshop.postaffiliatepro.com/scripts/j13l9o%27 type=%27text/javascript%27%3E%3C/script%3E"));
      </script>
      <script type="text/javascript">
      PostAffTracker.setAccountId('default1');
       
      var sale = PostAffTracker.createSale();
      sale.setTotalCost('<br />
      <b>Notice</b>: Undefined index: input50[2] in <b>/home/cls/public_html/order-confirmation.php</b> on line <b>61</b><br />
      ');
      sale.setOrderID('4');
      sale.setProductID('61984738873374');
      PostAffTracker.register();
      </script>
       

    Could really use some help to what is going on as I have no idea

    Thanks!

    Page URL:
    https://www.customlogoshop.com/order-test

    POST post data JotForm name table
  • Profile Image
    JotForm Support

    Answered by Kiran on July 19, 2016 at 03:09 PM

    I have cloned your JotForm and tried submitting the form. I see that the page is redirected to the following URL with the values posted correctly. 

    https://www.customlogoshop.com/order-checkout-test?input50[price]=124&input49=Total:%20%C2%A3124.00%20GBP

    From the code that you have provided, I see that you are calling a variable orderid which is not found in the form. Could you try redirecting the Thank you page to http://www.jotform.com/show-post-data/ to see what variables that you want to pass to the other page?

    Please check and let us know if you need any further assistance. We will be happy to assist. 

  • Profile Image

    Answered by customlogoshop on July 19, 2016 at 03:17 PM
    PHP Code:
    $_POST['submission_id'];
    $_POST['formID'];
    $_POST['ip'];
    $_POST['input49'];
    $_POST['input50']['0'];$_POST['input50']['1'];$_POST['input50']['2'];$_POST['input50']['3'];$_POST['input50']['4'];$_POST['input50']['5'];$_POST['input50']['6'];
    $_POST['orderid'];

    Im confused as it does say orderid?

    Am I adding it to PHP wrong? Please give me an example of how the php should inset the variables
  • Profile Image
    JotForm Support

    Answered by Welvin on July 19, 2016 at 04:46 PM

    There is the Order ID in this form: http://www.jotformeu.com/form/61984738873374. It is a unique ID widget.

    I think you're doing it wrong. 

    Form 1 https://www.customlogoshop.com/order-test is redirected to form 2: https://www.customlogoshop.com/order-checkout-test.

    Form 2 is redirected to https://www.customlogoshop.com/order-confirmation.

    Send Post Data is enabled in two forms. The redirection is correct as far as I could see. However, it seems that your page stripped off the scripts causing the integration to fail. Can you take a screenshot of the entire tracking scripts in your page, this while editing? We need to know if you have the correct tags. 

    Another thing, if you're getting the variables from form 2, you need to use the variables that are generated by the post data. 

    enteryour = Must be the full name in the payment fields so, ['input50']['1'] and ['input50']['2']

    enteryour4 = You do not have an email field in your form. You may consider adding one.

    selectyour = [input49] which is the calculation field or [orderid] which is the unique ID widget. 

     

    I hope that helps. Let us know if you need any further assistance.

  • Profile Image

    Answered by customlogoshop on July 19, 2016 at 05:13 PM

    It now works I got the code right finally :) 

    How can I pass over the email from form 1 to 2 but without displaying it in a field? just may look a bit odd having it on the form again

  • Profile Image

    Answered by customlogoshop on July 19, 2016 at 05:20 PM

    Also, when the user fills in part 1 but not part 2 (the checkout stage), how can I setup a notfication so they can carry it on from where they left off? so all their form data is saved and they can resume and hopefully then checkout? 

    Thanks!

  • Profile Image
    JotForm Support

    Answered by Chriistian on July 19, 2016 at 09:48 PM

    I am glad to know that it is now working. You can add an email field in Form 2, and pass the email there. Set it to Hidden so that it is not visible to the user. I checked your form 2 and it appears that you have already added a hidden email field.

    To better assist you, your other question has been moved to a new thread. Please follow this link to view it: https://www.jotform.com/answers/886451. Regards.