The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.25 (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.25 (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.25 (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.25 (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.25 (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.25 (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.25 (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 property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(257) : eval()'d code PHP 8.1.25 (Linux)
File Line Function
/printthread.php(257) : eval()'d code 2 errorHandler->error
/printthread.php 257 eval
/printthread.php 117 printthread_multipage
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.25 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.25 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Multiple PayPal Forms in same location - how? - 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: Multiple PayPal Forms in same location - how? (/showthread.php?tid=525)

Pages: 1 2


RE: Multiple PayPal Forms in same location - how? - Ben - Mar 11th, 2010

Hey guys,

Sorry for the wait! To recap:

Quote:I really don't want form_id added to any front-end links if at all possible, couldn't I just store in in a php variable in the form code?
Agreed! It would be nice to avoid.

Quote:By reading this am I correct that I'd have to link to the forms themselves with the ?form_id= appended or could I just send the formid from the form to the paypal processing page?

The simplest way is to pass the form ID via the query string, but there are other options - a couple of which I'll explain below.

You can't just send the form ID to the PayPal processing page because it's needed at the very start. The moment the user first arrives on the form page, the API function (ft_api_init_form_page()) does some work behind the scenes to store space in sessions for this particular session. It requires the form ID to work - that's basically the long and short of it.

So the problem is, since it needs to know right off the bat what the form ID is that we're interested in we have to tell it somehow. Passing it via the query string is a quick and easy solution to get around it.

But here's a couple of other options:

1. POST the form ID to the page instead of passing it via the query string. Whenever you link to the page, put the form_id in a form post, probably a hidden field.

This obviously isn't great. But at least the query string would be empty.

2. Instead of passing the form ID, pass in a descriptive string instead, e.g.

form.php?page=ApplicationForm
form.php?page=RegistrationForm
form.php?page=MyContactForm

(or whatever).

Then, in the PHP at the very top of your page, map those strings to a form ID, like this:

PHP Code:
$map = array(
  
"ApplicationForm" => 1,
  
"RegistrationForm" => 2,
  
"MyContactForm" => 3
    
);

$default_form_id 1// just in case!
$form_id = (isset($map[$request["page"]])) ? $map[$request["page"]] : $default_form_id

($request is a variable mentioned by Martin in a previous post. It's a the $_POST and $_GET hashes squished together).

And that's pretty much it.

Any help at all...?

- Ben