Example Button: Allows visitor to select the $$$ amount.

This working donation button will show your appreciation for our helpful pages.

Example #2 : Demostrates a shopping cart setup - in this example it's for one hour of training. BTW: The Web Host (ibdhost.com) for this site uses this shopping cart setup.

Webmaster Tutorials


Valid XHTML 1.0!
Valid CSS

Updated:
Jun 07, 2008

© 2003 - 2008

IBDhost

PayPal Setup

PayPal Business / Merchant Account Tip
plus Membership Donation Form Tutorial

Setup Business Account:

To start using a PayPal donation button (or other PayPal features - such as shopping cart), you need to sign up and use the Merchant Tools. The Merchant Tools section of PayPal has detailed instructions for donation, shopping, buy now buttons - that you can read and study before you sign up. However, small details such as being sure to 'check' the Business Account option are not obvious.

BTW: If you do Not want a full PayPal account, the Business Account can be set up with just the checking account deposit information. In other words, entering your personal credit card information is optional ! ! ! Something MOST people do not know i.e. do not give your credit number for business accounts that will 'bring in money'

After sign up, email and checking account information must be verified. PayPal will make two small deposits to the checking account and email a verification link to confirm the amounts (activate the account).

The PayPal Merchant Tools include complete instructions for Buy Now Buttons, PayPal Shopping Cart, Subscriptions and Recurring Payments and Donations. After you fill out the forms, a PayPal program / script will generate the HTML code to copy and paste in your web page. In other words, the tips for setting up the Merchant Account work equally well with shopping carts, etc, etc offered by PayPal

Summary:

Filling out the setup forms for a Business account (under Merchant Tools) is the difficult part of adding a PayPal donation button (or other shopping, buying options). However, once the account(s) are setup, just copy n paste the HTML Code into the web page(s) and start using your shopping cart - donation - etc. buttons to collect funds :)


Membership Form:

Sign up and pay with check:

This is a tutorial with detail setup instructions for a membership form (. To test the form use a valid email address to receive your copy of the submittal. Then copy the HTML / PHP code for the two sets of code shown below.

   Your Email: 

   First Name: 
    Last Name: 

    Address 1: 
    Address 2: 

         City: 
        State: 
          Zip: 

        Phone: 

Comments:
 

                   

Instructions:

Quick Start (Kiss) : (a)Host server must supports PHP scripts!. (b)Insert the donate.php code into your .php file. (c)Insert the thanks.php code into your thanks.php file. (d)Change the first three variables (myemail, snailmail and smailmail2) in the thanks.php. (e)That's it - just upload both files to same directory/folder. :)

More Details:
Step 1: If Not using a template (see notes), then create the first page (name = donate.html). Then finalize the .html page design i.e. finish your page layout / design.
Step 2: Rename the donate.html file to 'donate.php" - then copy and paste the php code shown below - under donate.php. Then upload the finally donate.php file
Step 3: Create a Thank You page (thanks.html) and finalize the design.
Step 4: Rename the thanks.html file to 'thanks.php" - then copy and paste the php code shown below - under thanks.php.
Step 5: THREE variables ($myemail, $snailmail, $snailmail2) in the thanks.php must be set for the form to work.
VIP: The spacing , quotation and comma placement in php is critical so just replace the existing info by changing only the 'text'
Replace the $myemail with YOUR email address
Replace the yourname, address (text) info with your text - in both $smailmail variables.
Step 6: Upload the thanks.php file to the same directory as the donate.php.


donate.php code


<form method="post" action="thanks.php">

<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>">
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>">
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>">

<pre>
Your Email: <input type="text" name="visitormail" size="20">

First Name: <input type="text" name="fname" size="20">
Last Name: <input type="text" name="lname" size="20">

Address 1: <input type="text" name="address1" size="20">
Address 2: <input type="text" name="address2" size="20">

City: <input type="text" name="city" size="20">
State: <input type="text" name="state" size="20">
Zip: <input type="text" name="zip" size="20">

Phone: <input type="text" name="phone" size="20">
Comments:
<textarea name="notes" rows="4" cols="31"></textarea>

<input type="submit" value="Verify - Submit">
</pre>
</form>


thanks.php code


<h3 align="center"> Thank You <?php echo $fname ?> </h3>

<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitormail = $_POST['visitormail'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$phone = $_POST['phone'];
$notes = $_POST['notes'];

$myemail = "youremail@yourdomain.com";

$snailmail = "
Your Name \n
Street Address \n
Your City State Zip\n";

$snailmail2 = "<br/> Your Name <br/>
Street Address <br/>
Your City <br/> State Zip <br/>";


if (!isset($visitormail))
echo "<font size=6>Somebody Goofed</font> $ip" ;

$todayis = date("l, F j, Y, g:i a") ;

$subject = "Membership Form" ;

$notes = stripcslashes($notes);

$nameis = $fname . " " . $lname;

$message = " $todayis [EST] \n
Email: $visitormail
Name: $nameis \n
Address: $address1
Address: $address2
City: $city
State: $state
Zip: $zip
Phone: $phone\n
Message: $notes \n
Mail Check To: $snailmail
";

$messageme = " $message \n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";


$from = "From: $myemail\r\n";

if ($visitormail != "")
mail($visitormail, $subject, $message, $from);

if ($myemail != "")
mail($myemail, $subject, $messageme, $from);

?>

<b><p align="center">
<?php echo $todayis ?>
<p>

Name: <?php echo $nameis ?> ( <?php echo $visitormail ?> )
<br/>
Address: <?php echo $address1 ?> <?php echo $address2 ?>
<br/>
City: <?php echo $city ?> <?php echo $state ?>
<br/>
Zip: <?php echo $zip ?>
<br/><br/>
Phone: <?php echo $phone ?>
<br/>
Comments:<br/>
<?php echo $notes ?>
<br/>
IP = <?php echo $ip ?>
<br/>
<br/>
Mail Check to: <?php echo $snailmail2 ?>

<br/><br/>
Please check this information, use 'back' if changes are required.

<br/> <br/>
<!-- *************************** PayPal Tip ************************

If this form is just a registration form to be used
with the PayPal donate button
- the button code could be included
HERE
-->


<br/>



Note 1: If you use SSI and external style sheets in a template (such as php template tutorial), it's easier to just use the two sets of code as SSI (php includes).
Note2: this simple example does not verify email address or store the input in a database.
Note3: For high volume site requiring database records, search for a MySQL database driven php script.
Note4: Free Javascript code can be used in the submit form to check for correct email format, etc. but it's so easy to fake the info that we do not use javascript or php input checks. As mentioned if the visitor wants to test the form and see what will be sent to visitors, they need to enter a valid email address. (BTW: the owner of the form will always get a copy and it will contain referral - other info not sent to the visitor.
Note 5: This tutorial does not have a line by line comment - detailed explanation of each step. However, for a $12.50 donation, we will make a commented copy then work with you on ICQ, AIM, etc until you understand every step. Just use the form and add a comment requesting this service. Then use the donate button with the same name, address, etc. Do NOT include your credit card number in the membership form - that info should only be entered at the secure PayPal site after using the donate button.

For additional form tutorials, try Feedback Form tutorial or Contact Us tutorial