Send Submission Data via Post Method and Thank You Settings

November 26, 2021

We are very familiar with the feature in Prepopulating the fields to your Jotform via URL Parameters wherein the form always receives the parameter data. With this feature, form fields are automatically given default values when a URL address to the form with included parameters is clicked.

What if you wanted to send the parameter data instead? And the target page is not a Jotform form?

  • Example A – you can simply send the data via the URL parameter as mentioned in the link first shared above, you can also check this link to a guide that allows you to send data to another URL by prepopulating the target URL parameter from the form fields of form #1.
  • Example B – we want to send the form field data to a target PHP script via HTTP POST method, this will NOT append the data in the URL parameter, which makes this method more secure.

Being able to directly send the information from a Jotform form into your own website or PHP script, provides a lot of flexibility in collecting data and as well as enhancing user’s experience since you are using your own custom web pages with JotForm.

This tutorial will show how to send submission data via the HTTP POST method and using the Thank You Page. This Jotform feature uses the POST request method which requires PHP.

The tutorial is divided into 2 parts:

Creating the Form

Log in to Jotform and create a form using the Form Builder. When you’re satisfied with the form…

Enable the Send Post Data

  1. Go to Settings.
  2. Hit the Show More Options button.
  3. Scroll down and set the Send Post Data option to Yes.
form-builder-send-post-data form-builder-send-post-data-gif

Redirect the Thank You Page

Use the Thank You Page wizard to add the URL address of the target PHP script.

To set this up, go to Settings » Thank You Page » Redirect to an external link after submission. Then input your PHP script’s address in the Enter URL field.

form-builder-thank-you-page-redirect form-builder-thank-you-page-redirect-jpg

The URL address should be the PHP page that exists on your website.

Creating the Custom PHP Page

The URL entered in the Thank You Page wizard’s “Redirect to an external link after submission” should be able to handle the HTTP POST request.

  1. Start creating your PHP web page using your editor (any text editor will do).
  2. For the purpose of this tutorial, copy and paste the following code into your text editor: <?php print_r($_POST); ?>
  3. Save the PHP page as redirect.php, or you can name it anything that you like, it should at least have an extension of .php as a file.
  4. Make sure it is deployed and located in your website with the same address as what you provided in the Thank You Page’s Enter URL field. For example, the URL address provided in the form’s Thank You page in my case is https://www.jotform.com/redirect.php

To use the data from the HTTP POST request, you need to know the correct keys of the $_POST variable. You can get the keys by following this guide: How to Post Submission Data to Thank You Page

An example is this Send POST Data form. The PHP code or $_POST variables for my fields are as follow:

  • $_POST['submission_id'];
  • $_POST['formID'];
  • $_POST['ip'];
  • $_POST['name']['0'];
  • $_POST['name']['1'];
  • $_POST['email'];
  • $_POST['message'];

Now in your PHP script, you can simply use those variables to process the data and use it as your own.

Notes

It is quite necessary that you have knowledge of PHP to fully utilize and implement this. I suggest checking the links below to help you get started.

Cases where you can implement this tutorial:

I hope that helps. Feel free to comment below. If you have questions or concerns, or you can also open a new thread on our forum page.

Do you want to make a PHP form? Please have a look at the page referred to.

Was this guide helpful?
Contact Support:

Our customer support team is available 24/7 and our average response time is between one to two hours.
Our team can be contacted via:

Support Forum: https://www.jotform.com/answers/

Contact Jotform Support: https://www.jotform.com/contact/

Send Comment:

Jotform Avatar
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Comment:

Podo CommentBe the first to comment.