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.

Retrieve Query Strings on WordPress success page

  1. Hi,

    I need some help! I don't understand how to use the Query Strings.

    I want Gravity Forms to redirect to a WordPress page and add a query string like ?name=Victor so that I can print something like "Thank you for your submission Victor!". How can I catch the my passed variable "name"? I've tried $_POST["name"] and get_query_variable("name") with no luck.

    Thanks in advance!

    Best regards

    Posted 13 years ago on Thursday January 6, 2011 | Permalink
  2. You would do this using the PHP $_GET function which is how you would display any query string using PHP.

    For example

    <?php echo $_GET["name"]; ?>

    Posted 13 years ago on Thursday January 6, 2011 | Permalink
  3. Aha!

    I'm still not getting anything. Shouldn't I see the Query String in the URL I'm getting redirected to, like mysite.com/success?name=victor ? Because I'm not..

    Posted 13 years ago on Thursday January 6, 2011 | Permalink
  4. If you aren't seeing success?name=victor in the query string in your browser address bar, then you did not setup the confirmation redirect correctly.

    Posted 13 years ago on Thursday January 6, 2011 | Permalink
  5. I ain't seeing it.. But when I tried to redirect to a regular .php file it works!

    But I want to redirect to one of my WordPress pages (with a custom template).. How can I do that!?

    Posted 13 years ago on Thursday January 6, 2011 | Permalink
  6. There are 3 options for the Confirmation:

    - Text
    - Page
    - Redirect

    Only "Redirect" has an option to pass query string values. If you are using "Page", that option isn't available. You have to choose Redirect.

    Then you enter the FULL URL permalink to the page you want to redirect to, and use the optional query string builder to build your query string.

    See this screenshot:

    http://www.gravityhelp.com/wp-content/uploads/2009/08/form-settings-confirmation-redirect.png

    Documentation is here:

    http://www.gravityhelp.com/documentation/form-settings/

    Posted 13 years ago on Thursday January 6, 2011 | Permalink