Software, your way.
How To Get Good Custom Software
(Download)
(PDF)
burger menu icon
WillMaster

WillMaster > LibraryManaging Website Forms

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Form Redirects to PayPal

The buyer fills in a form and, instead of a regular submit button, they click the PayPal button. The form information goes to you and the buyer goes to PayPal to arrange payment.

Submit the form to Master Form V4, as usual, so Master Form V4 could send the email and store the data on the server. The redirect URL, however, was a PayPal payment URL instead of a URL to a thank-you page.

It works a treat.

If you have a similar requirement, I'll show you how to do it. Perhaps you need contact or other information before the buyer is sent to PayPal:

  • To make the product ready for pickup when the customer gets back from PayPal.

  • If they have problems getting back to your site (which can happen if they pay by credit card and don't click the "return to merchant" link), you have their contact information to make things right.

  • If they abandon the payment page, you can get in touch with them to find out why.

Here's an example:

Name
Email
Phone
 

Implementation Overview

To implement this, you'll need form software that will handle an absolute http://... redirect URL (such as Master Form V4):

  1. Change the redirect URL to a PayPal buy-now URL.

  2. Change the submit button to type="image" with the PayPal image URL.

The step-by-step instructions that follow include how to obtain the PayPal buy-now and image URLs.

Step-by-step Implementation Instructions

Below is the code for a representation of the example form above.

<form method="post" action="FORM-SOFTWARE-URL" enctype="multipart/form-data">
<input type="hidden" name="redirect" value="PAYPAL-BUYNOW-URL">
<table border="0" cellpadding="3" cellspacing="0" style="margin:0 auto;">
<tr>
<td>Name</td>
<td><input type="text" name="name" style="width:200px;"></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" style="width:200px;"></td>
</tr>
<tr>
<td>Phone</td>
<td><input type="text" name="phone" style="width:200px;"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td style="text-align:center;">
<input type="image" src="PAYPAL-IMAGE-URL">
</td>
</tr>
</table>
</form>

The above form can be modified to suit your purposes or used as a guide for updating your own form.

Only three things are required, the form software URL, the PayPal buy-now URL, and the PayPal image URL:

  1. The URL to the software to handle form submission —

    The software you're using and where it's installed will determine what the URL is.

    Replace FORM-SOFTWARE-URL in the form code above with the URL to the software.

    If you don't have form handling software yet, get Master Form V4. It comes with free professional installation.

  2. The PayPal button image URL —

    Make a buy-now button at PayPal for the item name, item ID, and purchase amount of what is being sold.

    When you get to the page with the code, verify you're at the "Website" tab of the code box. On the right, you'll see a "Buyer's View" area with an image. Obtain the URL of that image.

    Replace PAYPAL-IMAGE-URL in the form code above with the image's URL.

    How you get the image URL depends on your browser. It should have a way to copy an image URL within the right-click menu. Perhaps you'll need to "view image" and then copy its URL from the browser.

    Example URL:

    https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif
    
  3. The PayPal buy-now URL —

    At the same page as the previous step, click on the "Email" tab of the code box. There, you'll find the buy-now URL.

    Replace PAYPAL-BUYNOW-URL in the form code above with at URL.

    Example URL:

    https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=38SM7VAXYJQ9W
    

There you go, three things to do and you have a form that submits to form handling software installed on your domain and then redirects the buyer to PayPal to arrange for the purchase.

It works just like expected of a normal form, except for one thing: The form's redirect is a PayPal buy-now URL instead of a thank-you page URL.

(This article first appeared in Possibilities ezine.)

Will Bontrager

Was this article helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method

All information in WillMaster Library articles is presented AS-IS.

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2024 Will Bontrager Software LLC