Software, your way.
burger menu icon
WillMaster

WillMaster > LibraryMarketing With Software

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!

PayPal Form Without Merchant ID

What if you want to use a form so people can order things from you or simply pay you money via PayPal? And what if you do not have a PayPal Merchant ID or don't know where to find it at the PayPal merchant's dashboard?

You can submit your form to PayPal using your email address instead of your Merchant ID.

The thing about that is the email address is vulnerable to spambot address harvesting, even if the address is in a type="hidden" form field.

Instead of putting the email address into the form, the form can be submitted to a relay script. The relay script inserts your PayPal email address into the proper form field and sends the payment authorization order to PayPal.

Here is the relay script. Customization note follows.

<?php
/*
Form to PayPal with Email Address
Version 1.0
December 24, 2024
Will Bontrager Software LLC
https://www.willmaster.com/
*/

/* Customization. Specify the PayPal email address. */

$PayPalEmail = "name@example.com";

/* End of customization. */

if( empty($_POST) or (count($_POST)<2) ) { echo 'Inappropriate Access'; exit; }
mb_regex_encoding('UTF-8');
mb_internal_encoding('UTF-8');
date_default_timezone_set('UTC');
$items = array();
$items[] = 'business='.rawurlencode($PayPalEmail);
foreach( $_POST as $k => $v )
{
   $LogLine[] = str_replace('"','""',"$kk=$vv");
   $kk = rawurlencode($kk);
   $vv = rawurlencode($vv);
   $items[] = "$kk=$vv";
}
$PayPalURL = 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&'.implode('&',$items);
if( headers_sent() ) { echo "<script>location.href='$PayPalURL'</script>"; }
else { header("Location: $PayPalURL"); }
exit;
?>

There is one place to customize, your PayPal email address. Replace name@example.com with your PayPal email address.

Installation

First, the relay script needs to be uploaded.

  1. Name the customized relay script paypalsupport.php or other *.php file name you prefer.

  2. Upload paypalsupport.php to your server and make a note of its URL.

Then, your PayPal form needs to be modified.

  1. Change the form tag's action attribute from the PayPal URL to the URL of the paypalsupport.php script.

  2. Remove the hidden field that currently contains your email address or PayPal Merchant ID.

That's it. You should be good to go. But test it, of course.

When it passes, your PayPal form is submitted to the paypalsupport.php script. The paypalsupport.php script adds your PayPal Merchant ID or your PayPal email address. Then all that information (the form information and your PayPal identification) is sent to PayPal.

The buyer is taken to PayPal to arrange payment, just like the buyer would expect.

If you do not know how to build a form for people to use to pay you, here are two articles. Each describes how to make a PayPal form. The first, PayPal Send-Money Form, describes how to make a simple send-money form. The second, Checkbox Shopping Cart, describes how to make a more elaborate form that can function as a shopping cart.

(This article first appeared with an issue of the Possibilities newsletter.)

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-2025 Will Bontrager Software LLC