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.

echo $entry causes Warning:Cannot modify header information

  1. I just bought this plugin and I can't get it working the way I want yet.

    Here's what I want to do:
    1 - Create a from in the sidebar and redirect it's results to Search.php when hitting the Send button
    2 - In Search.php use some data from the form to create a Buy button which will open Confirm.php
    3 - In Confirm.php use data from the form and Search.php to create a new form.

    Unfortunately, I can't pass step 1 because when I click the send button I have the following error

    2012-07-03
    Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/NihadCar/wp-content/themes/CaRental/functions.php:42) in /Applications/MAMP/htdocs/NihadCar/wp-content/plugins/gravityforms/form_display.php on line 83

    2012-07-03 is the value I'm looking for

    I simply added this to the functions file to start testing:

    function set_post_content($entry, $form){
    	echo $entry["1"];
    }
    add_action("gform_after_submission_3", "set_post_content", 10, 2);

    If I replace echo with return no errors but no output either!

    I'm testing locally so I can't give any DEMO
    I'm using Mamp Pro with Lion

    Posted 11 years ago on Tuesday July 3, 2012 | Permalink
  2. In step one, how are you doing this:

    "redirect it's results"

    After the form is submitted, how are you getting the values to search.php? I assume search.php is a template in your theme folder?

    Posted 11 years ago on Tuesday July 3, 2012 | Permalink
  3. Maybe I'm wrong, but i thought I could use gform_after_submission to display data from the form !

    In the form setting I used the redirection option to call Search.php

    In search.php I have a variable and I want it to have the value of the field $entry[1]

    I have managed to do the job by passing the values by Query String but I really don't wont the URL to get ugly, so If I could use something else it would be great.

    Thanks for your answer

    Posted 11 years ago on Wednesday July 4, 2012 | Permalink
  4. Maybe I'm wrong, but i thought I could use gform_after_submission to display data from the form !

    This action hook is executed at the end of the submission process (after form validation, notification, and entry creation).

    Query string might be your best option here, especially if it works.

    Posted 11 years ago on Wednesday July 4, 2012 | Permalink
  5. Yes query string works fine but I don't want all the data to appear in the URL adress.

    Yes I want to get the data after the submission, I thought that I can create a global variable in the Filter Call and use that global variable elsewhere, I think I don't understand how to use filters.

    Posted 11 years ago on Wednesday July 4, 2012 | Permalink