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
/showthread.php 26 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
/showthread.php 26 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
/showthread.php 26 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
/showthread.php 26 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
/showthread.php 26 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
/showthread.php 26 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
/showthread.php 137 forum_permissions
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
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 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 1952 - File: inc/functions.php PHP 8.1.28 (Linux)
File Line Function
/inc/functions.php 1952 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 629 mark_thread_read
Warning [2] Undefined property: MyLanguage::$ratings_update_error - Line: 5 - File: showthread.php(732) : eval()'d code PHP 8.1.28 (Linux)
File Line Function
/showthread.php(732) : eval()'d code 5 errorHandler->error
/showthread.php 732 eval
Warning [2] Undefined variable $postsdone - Line: 867 - File: showthread.php PHP 8.1.28 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Trying to access array offset on value of type null - Line: 867 - File: showthread.php PHP 8.1.28 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 3007 - Line: 867 - File: showthread.php PHP 8.1.28 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 3011 - Line: 867 - File: showthread.php PHP 8.1.28 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 3027 - Line: 867 - File: showthread.php PHP 8.1.28 (Linux)
File Line Function
/showthread.php 867 errorHandler->error
Warning [2] Undefined array key 3007 - Line: 1576 - File: showthread.php PHP 8.1.28 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key 3011 - Line: 1576 - File: showthread.php PHP 8.1.28 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
Warning [2] Undefined array key 3027 - Line: 1576 - File: showthread.php PHP 8.1.28 (Linux)
File Line Function
/showthread.php 1576 errorHandler->error
/showthread.php 1578 buildtree
/showthread.php 879 buildtree
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_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 880 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.28 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 880 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.28 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 880 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.28 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 880 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.28 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 880 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1506 - File: showthread.php PHP 8.1.28 (Linux)
File Line Function
/showthread.php 1506 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 30 - File: showthread.php(1533) : eval()'d code PHP 8.1.28 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 30 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $multipage - Line: 33 - File: showthread.php(1533) : eval()'d code PHP 8.1.28 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 33 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $multipage - Line: 65 - File: showthread.php(1533) : eval()'d code PHP 8.1.28 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 65 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $addremovesubscription - Line: 79 - File: showthread.php(1533) : eval()'d code PHP 8.1.28 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 79 errorHandler->error
/showthread.php 1533 eval



FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PayPal demo: Multiple dollar selects.
#4
Hi Scott,

Sounds like you're making progress, at least!

For the 100 Error, double-check that you're not passing along another form ID via a hidden field in your form. Most Form Tools forms work like that, so it's possible that there's a value there that's overwriting the $pp["form_id"] value. That's tripped me up on a couple of occasions. If that doesn't help, post us back.

Michael - excellent post! Yes, using the Submission Pre-Parser is the definitely the best approach for changing or combining any form data prior to it getting into Form Tools. But PayPal integrations are ever so slightly different and it won't completely work in this instance.

It's actually a rather subtle problem, so to better explain, here's a quick run-down of the process:

(1) The form. At the top of this page - and the second paypal_submit.php file - is a function called ft_api_init_form_page(). This does the job of keeping track of what's been submitted up to that point, and establish a bucket of storage ("sessions") where the form info should be logged.

Now, after the user fills in the form & clicks submit, the form submits the data to itself, which then (a) stores the latest POST data via ft_api_ini_form_page() and (b) calls ft_api_process_form(). At that point, the Submission Pre-Parser module kicks into action and sums up the total and stores it in "amount". Then, assuming your Form Tools form has an "amount" database field, it'll be stored in the database. Now even though your code to tot up the amount has doctored the POST variable, it won't be remembered!

You see, the ftp_api_process_form() THEN redirects to the paypal_submit.php page, and doesn't forward the POST content at that point. The assumption is that the ft_api_init_form_page() has already done the job of saving the latest POST info in sessions, so on the paypal_submit.php page, it's retrieved from there instead.

Problem!

So Scott, I'd suggest moving that code you wrote for the pre-parser right into the top of your form before ft_api_init_form_page() is called. What THAT will do is update the POST info prior to it being stored in sessions, to that after the script redirects to paypal_submit.php, it'll have the latest & greatest POST content - including your "amount" key.

Clear as mud...? Eesh, sorry. Hope it makes sense. But here's some sample PHP of how I'd add it to your form page.

PHP Code:
<?php

$curr_folder 
dirname(__FILE__);
require_once(
"$curr_folder/includes/library.php");
require_once(
"../global/short_library.php");

// if the user just posted something to the page, it's safe to assume the form 
// was just submitted. 
if (isset($_POST))
{
  if (isset(
$_POST["session1"]) && ($_POST[session1] != "-" ))
    
settype($_POST["session1"], "integer"); // convert the value of session1 to integer if the user set one
  
else
    
$_POST["session1"] = 0// otherwise set the value to 0

  
if (isset($_POST["session2"]) && ($_POST[session2] != "-" ))
    
settype($_POST["session2"], "integer"); // convert the value of session1 to integer if the user set one
  
else
    
$_POST["session2"] = 0// otherwise set the value to 0

  
if (isset($_POST["donate"]) && !empty($_POST["donate"]))
    
settype($_POST["donate"], "integer"); // convert the value of donate to integer if the user set one
  
else
    
$_POST["session2"] = 0// otherwise set the value to 0

  
$added_amount $_POST["session1"] + $_POST["session2"] + $_POST["donate"// add the three values together and store them in a variable

  
if ($added_amount == 0)
  
/* you presumably don’t want to continue to PayPal if the user didn’t select anything,
     add code to handle that case here */
  
else
    
$_POST["amount"] = $added_amount// submit the combined values as amount 
}
$fields ft_api_init_form_page($pp["form_id"], $pp["mode"]);

if (
$pp["mode"] == "initialize")
{
  
$params = array(
    
"submit_button" => "donate",
    
"next_page" => "success.php",
    
"form_data" => $_POST,
        
"finalize" => true
  
);
}
else
{
  
$params = array(
    
"submit_button" => "donate",
    
"next_page" => "paypal_submit.php",
    
"form_data" => $_POST
  
);
}
ft_api_process_form($params); 

Lastly, delete the pre-parser rule. The above should take care of it for both Form Tools' and the PayPal form's benefit.

Good luck! Smile

- Ben
Reply


Messages In This Thread
PayPal demo: Multiple dollar selects. - by Scott - Jul 4th, 2010, 9:47 PM
RE: PayPal demo: Multiple dollar selects. - by Scott - Jul 6th, 2010, 9:34 AM
RE: PayPal demo: Multiple dollar selects. - by Ben - Jul 10th, 2010, 9:40 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)