You are missing our premiere tool bar navigation system! Register and use it for FREE!

•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
· Home
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 367 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
How to display HTML forms in a block: Paypal

20.9. How to display HTML forms in a block: Paypal

A lot of sites have a block, asking for donations through PayPal. It is easy to construct your own, all you need is get an account from PayPal, then construct an HTML form that contains your data, for example:

Help  keep our web site online with a donation!
<form action="" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="My email">
<input type="hidden" name="item_name" value="My Homepage">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="image" src="" 
name="submit" alt="Make payments with PayPal - it"s fast, free and secure!">

The meaning of the form fields is the following:


Must be set to "_xclick" (required).


This is your PayPal ID, or email address, where payments will be sent. This email address must be confirmed and linked to your Verified Business or Premier account. (required).


Description of donation (maximum 127 characters). If omitted, donor will see a field in which they have the option of entering an Item Name (optional).


The price or amount of the purchase, not including shipping, handling, or tax. If omitted, this value will be editable by the buyer at the time of purchase (optional).


Including a note with payment. If set to 1, your customer will not be prompted to include a note. If omitted or set to 0, your customer will be prompted to include a note (optional).


The currency of the payment. Defines the currency in which the monetary variables (amount, shipping, shipping2, handling, tax) are denoted. Possible values are USD (U.S. Dollar), EUR (Euro), GBP (Pound Sterling), CAD (Canadian Dollar), JPY (Yen). If omitted, all monetary fields will be interpreted as U.S. Dollars (optional).


Transaction-based tax override variable. Set to a flat tax amount you would like to apply to the transaction regardless of the buyer s location. If present, this value overrides any tax settings that may be set in the seller s Profile. If omitted, Profile tax settings (if any) will apply (optional).

Tip PayPal hyperlink variables

There are many more hyperlink variables that you can use in your PayPal block, covering all aspects of a donation transaction. You should consult the PayPal Donations Manual, to learn about all the possibilities!

Figure 20-12. PayPal donation button

PayPal donation button

Pasting the code above into your website would generate a button that looks like Figure 20-12. To create a block out of this HTML Form, all we have to do is add the obligatory check for the block name, transform all lines to strings and append them to the $content variable, taking care to escape all double quotes between the string quotes:

if (eregi("block-Donations.php",$PHP_SELF)) {
    Header("Location: index.php");
$content  =  "Help  keep our web site online with a donation!";
$content  .= "form action=\"\" method=\"post\">";
$content  .= "input type=\"hidden\" name=\"cmd\" value=\"_xclick\">";
$content  .= "input type=\"hidden\" name=\"business\" value=\"My email\">";
$content  .= "input type=\"hidden\" name=\"item_name\" value=\"My Homepage\">";
$content  .= "input type=\"hidden\" name=\"amount\" value=\"10.00\">";
$content  .= "input type=\"hidden\" name=\"no_note\" value=\"1\">";
$content  .= "input type=\"hidden\" name=\"currency_code\" value=\"USD\">";
$content  .= "input type=\"hidden\" name=\"tax\" value=\"0\">";
$content  .= "input type=\"image\" src=\"\"
              border=\"0\" name=\"submit\" 
              alt=\"Make payments with PayPal - it"s fast, free and secure!\">";
$content  .= "/form>";

Put the above code in a file called block-Donations.php in the blocks folder. Then, just activate and position the block from the blocks management link in the administration panel.

Figure 20-13. PayPal donation block.

PayPal donation block.

Depending on your theme, the block will look as in Figure 20-13. You can experiment with various button images from the PayPal site. For more information on donations with PayPal, see the PayPal Donations Manual.

Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.185 Seconds - 334 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded ( ::