PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

POST vs GET

  1. tinker
    Member

    Is there a way to get your hands on form data via POST rather than GET?

    I see there is a built in option to pass on data via query string using GET but need POST data to also be available for manipulation.

    Posted 7 years ago on Monday April 16, 2012 | Permalink
  2. David Peralty
    Administrator

    Can you give me more details on what you are trying to do?

    Posted 7 years ago on Monday April 16, 2012 | Permalink
  3. tinker
    Member

    I just need to pass on form data to a yet to be identified page via post. Not sure if it is going to be within the same domain or not yet. I guess I could just use the built in query strings and send data to a page where it is then converted and sent via POST but that seems a bit over the top.

    Posted 7 years ago on Tuesday April 17, 2012 | Permalink
  4. There is no built in functionality to post form data to a 3rd party URL. This is because Gravity Forms POSTS to itself as it has to act as the form processor in order to function properly. As you are aware, the confirmation redirect option can be used to perform a GET when the form is submitted, but that is simply because a GET is a URL request that uses the query string to pass data.

    However, you can still accomplish what you want to do via the available developer hooks, filters and PHP.

    Typically when users want to POST data to a 3rd party location as part of the form submission process they want this to happen behind the scenes. They don't want to redirect the user anywhere, they simply want to send data via a POST to a 3rd party handler.

    You would do this is by using the gform_after_submission hook and custom PHP to perform whatever custom functionality you need. The gform_after_submission hook has access to all of the entry data for the form submission and will allow you to execute your own custom PHP that posts the entry data to your custom handler and gives you complete control in how that data is posted.

    The gform_after_submission hook is documented here:

    http://www.gravityhelp.com/documentation/page/Gform_after_submission

    You would need to know how to use PHP to post data in order to write this custom code. It's a little different because the POST is happening via PHP behind the scenes after the Gravity Form itself has been submitted and not via a traditional form submit action which in this case is being controlled by Gravity Forms. This is typically done using cURL but it can also be done with pure PHP5. Here are some references I found doing a quick Google search:

    http://wezfurlong.org/blog/2006/nov/http-post-from-php-without-curl/

    http://www.askapache.com/php/sending-post-form-data-php-curl.html

    You would place your custom code either in your themes functions.php or you could create your own custom WordPress plugin to house your custom code that you would then install and activate on the site you want to implement the customization on.

    Posted 7 years ago on Tuesday April 17, 2012 | Permalink

This topic has been resolved and has been closed to new replies.