How can I successfully pass URL variables to a form?

  • Michty6
    Asked on April 23, 2019 at 4:55 PM

    Hi there, 

    I have a hidden field in a form (called "original" for the original landing page). In my header I have a PHP Session that records the landing page to a variable and then I pass this to the jotform url in the iframe (e.g. src="https://form.jotform.com/83284630984264?original=<?php echo $original_landing_page ?>)


    This seems to work on some apps, but not on others. I've checked the code on our end and echoed pages to confirm that it is carrying through to the form page, but for some reason this variable is being shown as blank on a completed app.


    Do you know how we could go about consistently passing these variables - it's important to us to know which landing pages these leads came from.


    Thanks,
    Jason

  • jherwin
    Replied on April 23, 2019 at 5:42 PM

    Please see the code here: https://pastebin.com/4Z4rsizE and apply it to your webpage.

    $original_landing_page = $_GET['original_landing_page'];
    src='https://form.jotform.com/83284630984264?original=$original_landing_page'

    Please give it a try and let us know how it goes.

  • Michty6
    Replied on April 24, 2019 at 11:19 AM

    Thanks for the quick reply.

     

    I'm not passing the variable to the URL that the page the form is on though. We're using a $_SESSION variable to store the original landing page and then call on this in the iframe. It works in some of our forms but not all and it is inconsistent as well.

     1556118979Screen Shot 2019 04 24 at 11 Screenshot 10

     

    And then in the iframe:

      src='https://form.jotform.com/83284630984264?original='



  • Nik_C
    Replied on April 24, 2019 at 1:39 PM

    Since this goes a bit out of our scope here in the Support forum, could you please forward your inquiry to api@jotform.com so our colleagues that are more knowledgable about the topic can assist you.

    Thank you.