This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Is the $table_data[] array available in post-functions.php (version 3.2).


  1. Steve1951
    Member

    I want to add additional data to $paypal_params[] to be included in $merchant_redirect_url around line 2974 in post-functions.php but the element I need $table_data['element_3'] seems to be empty. As a test I added the following just above line

    $merchant_redirect_url = 'https://www.paypal.com/cgi-bin/webscr?'.http_build_query($paypal_params,'','&');

    echo "(1)This is a test.";
    $vartest = $table_data['element_3'];
    echo "(2)|$vartest|";

    and here is the result

    (1)This is a test.(2)||

    As you can see, $table_data['element_3'] is empty.

    Here is the HTML code generated (to verify I am using the correct element).

    </li>		<li id="li_3" >
    <label class="description" for="element_3">Email <span id="required_3" class="required">*</span></label>
    <div>
    <input id="element_3" name="element_3" class="element text medium" type="text" maxlength="255" value="" />
    </div>
    
    </li>

    What am I missing?

    Posted 11 years ago #
  2. yuniar

    The $table_data is not available within that function indeed. The easiest way is by storing the $table_data from "process_form()" function into session variable and then access the session variable from within the "mf_get_merchant_redirect_url()" function you mentioned above.

    Are you using a single page or multi page form? Also, is "form review" enabled?


    MachForm Founder

    Posted 11 years ago #
  3. Steve1951
    Member

    I am using a single page and form review is enabled. I stored the $table_data in a session variable "in function mf_process_form()" and now everything is working fine.

    Posted 11 years ago #

RSS feed for this topic

Reply