Search »

Adding the donation form to Form Tools

1. Upload the entire content of the zipfile to your website, perhaps in a /donate folder. Open up the index.php file in your browser. You should see an error about not being able to locate the api.php file.

2. Edit the /includes/library.php. At the very top, you'll see these lines:

Donation Form (PayPal Integration)
Donation Form (PayPal Integration)
You'll need to update the path to your api.php file. It's found in your Form Tools /global/api folder. Note that you'll need to use a path, not a URL. When the path is correct, you'll be able to load up the index.php page in your browser and see a page that looks like the screenshot to the right.

3. Edit the form in your favourite editor. Right after the opening form tag you'll see this hidden field:

This will appear as the "payee", or what the person is paying for. Change the value to whatever you want. I included this directly in the form since it's very possible you'll want that value to change depending on what's being ordered. So you can always change it to a dropdown, or something like that. As long as the field has the name "item_name", it should work.

4. Log into Form Tools and click on the "Add Form" button on the Forms page.

Add Form - Main Info (PayPal Integration)
Add Form - Main Info (PayPal Integration)
5. On the second page ("Main Information") fill in the Form Name and Form URL fields as shown in the screenshot to the right. The Form URL should point to the first page of your form. Leave the Redirect URL field blank and choose whatever permissions you want.

6. On the Test Submission page, click the "Code" button. This will generate some PHP and HTML for your particular form. The line we're interested in look something like this:

Here, the form ID is 43. It will almost certainly be different for your form. Ignore the instructions on the page - they're correct for all other forms, but for this example, the work is taken care of for you.

7. In an editor, open up your /includes/library.php file (included in the main zipfile) and update the following line for your own form ID:

8. Now it's time to put through our test submission! Open up the index.php page in your browser, fill in the fields and submit the form. You should see a Form Tools page with the heading "Test Submission Received". At this point, return to the Form Tools UI and finish setting up your form. For more information on the intracies of the various Add Form pages, see the Help Documentation. It's important that you DO finish setting up the form before proceeding to the next step. The following steps require you to have a valid, finished form configuration.

On the final page of the Add Form process ("Finalize Form") it provides some instructions to remove the form_tools_initialize_form field. Ignore this. Instead, again open up your /includes/library.php file and find these two lines:

Update the second line to this:

9. Go to your success.php page in your browser. This is found in the same folder as the index.php. When you go there, you'll see a blank "success" page thanking the user for their donation. Any time you go to this page, the sessions are emptied - this basically clears the cache of any temporary form information and unique submission IDs. If you ever get stuck, always manually go to this page to empty your cache.

10. Open up the donation form again in your browser (index.php). Put through another submission, this time you should be redirected to PayPal. You should see a page that looks something like this:

PayPal Sandbox Login
PayPal Sandbox Login

So far so good! Now onto the PayPal integration!