The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.28 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.28 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.28 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.28 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.28 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.28 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.28 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.28 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Two forms- same page confusion - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Two forms- same page confusion (/showthread.php?tid=586)



Two forms- same page confusion - filch - Mar 20th, 2010

I thought that perhaps it was better/easier to break my question out as it may simply be confusion on my part and did not want to confuse the other thread as well.

So, I am trying to get multiple forms working on one page and am starting with trying to get the first two going. here is what I have for code on the forms page:

Code:
<?php
require_once("/web/home/support/docs/assets/scripts/formtools/global/api/api.php");

$fields_9 = ft_api_init_form_page(9, $pp["mode"], "form_tools_form_9");
$fields_10 = ft_api_init_form_page(10, $pp["mode"], "form_tools_form_10");
if(isset($_POST['v-docSubmit'])) {
    if ($pp["mode"] == "initialize") {
        $params = array(
            "namespace" => "form_tools_form_9",
            "submit_button" => "v-docSubmit",
            "next_page" => "entry-thanks.php",
            "form_data" => stripslashes_deep($_POST),
            "finalize" => true
        );
    } else {
        $params = array(
            "namespace" => "form_tools_form_9",
            "submit_button" => "v-docSubmit",
            "next_page" => "entry-thanks.php",
            "form_data" => stripslashes_deep($_POST),
        );
    }
    ft_api_process_form($params);
} else if (isset($_POST['vd-Submit'])) {

    if ($pp["mode"] == "initialize") {
        $params = array(
            "namespace" => "form_tools_form_10",
            "submit_button" => "vd-Submit",
            "next_page" => "entry-thanks.php",
            "form_data" => stripslashes_deep($_POST),
            "finalize" => true
        );
    } else {
        $params = array(
            "namespace" => "form_tools_form_10",
            "submit_button" => "vd-Submit",
            "next_page" => "entry-thanks.php",
            "form_data" => stripslashes_deep($_POST),
        );
    }
    ft_api_process_form($params);
}
?>

With this, I am getting a 200 error, which is saying that the second parameter I have is wrong ($pp["mode"]). I guess what I am confused about in this case is where the value of $pp["mode"] comes from. Do I have to set that to "initialize" or "live" somewhere else? Or, does it come from the API? Also, if the mode is not initialize, do I not still have to have finalize=>true in there as well?

Thanks for any help clearing this up.

Dave


RE: Two forms- same page confusion - martin_undefined - Mar 21st, 2010

Quote: I guess what I am confused about in this case is where the value of $pp["mode"] comes from. Do I have to set that to "initialize" or "live" somewhere else? Or, does it come from the API?
Hi,

I believe the $pp["mode"] is set in the library.php file that comes with the Paypal demo.

Martin


RE: Two forms- same page confusion - filch - Mar 21st, 2010

(Mar 21st, 2010, 3:19 PM)martin_undefined Wrote:
Quote: I guess what I am confused about in this case is where the value of $pp["mode"] comes from. Do I have to set that to "initialize" or "live" somewhere else? Or, does it come from the API?
Hi,

I believe the $pp["mode"] is set in the library.php file that comes with the Paypal demo.

Martin

So, this variable is really only used when interfacing with PayPal? Is it something you manually set in library.php or is it set dynamically?

Cheers

Dave


RE: Two forms- same page confusion - martin_undefined - Mar 21st, 2010

Hi,

In the example and how I've used it, it's just set manually in the form:

Code:
// the Form Tools submission mode
$pp["mode"] = "live";

I think it is only used with Paypal.

Martin
(Mar 21st, 2010, 3:22 PM)filch Wrote:
(Mar 21st, 2010, 3:19 PM)martin_undefined Wrote:
Quote: I guess what I am confused about in this case is where the value of $pp["mode"] comes from. Do I have to set that to "initialize" or "live" somewhere else? Or, does it come from the API?
Hi,

I believe the $pp["mode"] is set in the library.php file that comes with the Paypal demo.

Martin

So, this variable is really only used when interfacing with PayPal? Is it something you manually set in library.php or is it set dynamically?

Cheers

Dave



RE: Two forms- same page confusion - filch - Mar 21st, 2010

OK ... that is more or less what I did. Just seems a bit klugey ... especially if there are several forms on the page like I have.

Anyway ... thanks for your responses.

Cheers

Dave

(Mar 21st, 2010, 3:29 PM)martin_undefined Wrote: Hi,

In the example and how I've used it, it's just set manually in the form:

Code:
// the Form Tools submission mode
$pp["mode"] = "live";

I think it is only used with Paypal.

Martin
(Mar 21st, 2010, 3:22 PM)filch Wrote:
(Mar 21st, 2010, 3:19 PM)martin_undefined Wrote:
Quote: I guess what I am confused about in this case is where the value of $pp["mode"] comes from. Do I have to set that to "initialize" or "live" somewhere else? Or, does it come from the API?
Hi,

I believe the $pp["mode"] is set in the library.php file that comes with the Paypal demo.

Martin

So, this variable is really only used when interfacing with PayPal? Is it something you manually set in library.php or is it set dynamically?

Cheers

Dave



RE: Two forms- same page confusion - Ben - Mar 22nd, 2010

It *is* a little klunky, you're right.

Multiple forms on a single page was something I took into account with the API, but not with the PayPal example script - that was really just designed for a single form. That said, it's quite possible as described in the other thread to get it all going; just takes a lot of fiddling....

- Ben


RE: Two forms- same page confusion - filch - Mar 22nd, 2010

(Mar 22nd, 2010, 8:15 PM)Ben Wrote: It *is* a little klunky, you're right.

Multiple forms on a single page was something I took into account with the API, but not with the PayPal example script - that was really just designed for a single form. That said, it's quite possible as described in the other thread to get it all going; just takes a lot of fiddling....

- Ben

I have it going ... but I cannot get the files to upload. It puts a reference in the database ... but no file is uploaded.

Any idea what might be happening here?

Dave