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

    Passing information from one form to another using php

    Asked by kauseway on August 28, 2015 at 11:12 PM

    So you guys helped me to build 2 iframe forms. Where the first form passes Address, postal code, name and email to the second. I did notice that it is not passing first name now for some reason?

    http://www.jotform.us/kauseway/book_now

    http://form.jotformpro.com/form/50005155818954

     

    But I just built a new form and I want to pass that information to form 50005155818954.  I just made sure all the name field details matched the book_now form but it still didnt work. Can you help me try and fix this? I will post the php I am using that you helped me build originally below.

    http://form.jotformpro.com/form/52396454318966  (new form)

     

    Also here are they are on the webpages:

    https://naturalcarecleaningservice.com/book-now/  (original form 1)

    https://naturalcarecleaningservice.com/book-now-checkout/  (original form 2)

    https://naturalcarecleaningservice.com/ (new form 1 that I want to use and pass info to form 2)

     

     

     

    if(isset($_REQUEST['email'], $_REQUEST['beds1'], $_REQUEST['baths2'], $_REQUEST['freq'], $_REQUEST['postal'],$_REQUEST['sqft'], $_REQUEST['address'], $_REQUEST['phone']))

       {

          $email = $_REQUEST['email'];

          $beds = $_REQUEST['beds1'];

          $baths = $_REQUEST['baths2'];

          $freq = $_REQUEST['freq'];

          $postal = $_REQUEST['postal'];

          $sqft = $_REQUEST['sqft'];

          $phone = $_REQUEST['phone'];

          $address = $_REQUEST['address'];

     

          /*

             Here you can now use the variables above for any extra / relevant use that you might need on your website besides passing the value to iframe

          */

     

          $params = '?a' . mt_rand(100,500) . '=' . mt_rand(10,5000) . '&email=' . $email . '&beds=' . $beds . '&baths=' . $baths . '&freq=' . $freq . '&postal=' . $postal . '&address=' . $address . '&phone=' . $phone .  '&sqft=' . $sqft;

       }

       else { $params = ''; }

       //echo "Params".$params;

     

     

       echo "<iframe id='JotFormIFrame' onload='window.parent.scrollTo(0,0) ' allowtransparency='true' src='https://secure.jotformpro.com/form/50005155818954".$params."' frameborder='0' style='width:100%; height:5857px; border:none; ' scrolling='no'></iframe>

    <script type='text/javascript'>window.handleIFrameMessage = function(e) {var args = e.data.split(':');var iframe = document.getElementById('JotFormIFrame');if (!iframe)return;switch (args[0]) {case 'scrollIntoView':iframe.scrollIntoView();break;case 'setHeight':iframe.style.height = args[1] + 'px';break;case 'collapseErrorPage':if (iframe.clientHeight > window.innerHeight) {iframe.style.height = window.innerHeight + 'px';}break;case 'reloadPage':window.location.reload();break;}};if (window.addEventListener) {window.addEventListener('message', handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent('onmessage', handleIFrameMessage);}</script>

    ";

     

    Page URL:
    http://form.jotformpro.com/form/52396454318966

    one form information another new form JotForm style POST name
  • Profile Image
    JotForm Support

    Answered by BDAVID on August 29, 2015 at 08:10 PM

    Here is a guide to send Post data from JotForm using PHP: https://www.jotform.com/help/213-Send-POST-Data-From-JotForm-Using-PHP-in-Custom-Thank-You-Page

    Basically, you will send in an array container the submission data to an external Php page, which will process and send the data to you specific pages. For this you will need to hire a PHP programmer to help you accomplish what you need.

  • Profile Image

    Answered by kauseway on August 29, 2015 at 08:48 PM

    You guys helped me and I did hire one. These two form work fine:

     

    http://www.jotform.us/kauseway/book_now  passes to the one below

    http://form.jotformpro.com/form/50005155818954

     

    I recreated the first form but it is not passing. 

    http://form.jotformpro.com/form/52396454318966

     

    Can you tell me why?  The first old form does not have php redirect. The php is on the page and it works.

     

     

  • Profile Image
    JotForm Support

    Answered by Jan on August 30, 2015 at 03:03 AM

    According to this thread your were advised to use $_GET and not $_REQUEST. On the PHP code you provided, all of them are using $_REQUEST. 

    Please advised your PHP programmer to check that thread and see if he can do it. Otherwise, we recommend using the POST data through PHP redirect.

    Hope that helps. Thank you.