PHP-KeyCodes

Adding buy now buttons

Email :

PayPal buttons

To create a PayPal buy now button, go to the 'Product List' page in the admin area. Against each product is a 'Show button' link which takes you to a button generator page where you can copy the text and paste it on to your web page.

Clicking on a 'Buy now' button immediately takes you to the checkout where the customer can buy the defined license key code.

The button or buttons may be placed anywhere on an existing web page which makes it easy to integrate into an existing design. The web page can be of php extension or an ordinary htm page.

<form action="http://www.yourservername/phpkeycodes/ipn/process.php" method="post">
<input type="hidden" name="recid" value="1">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" 
alt="Make payments with PayPal - it's fast, free and secure!">
</form>

The fields that you enter to create the button are :
  • The action url is http://www.yourservername/phpkeycodes/ipn/process.php assuming that you have installed PHP-KeyCodes at the root of your web site in a folder called 'phpkeycodes'.
  • The value is the recid for the product you wish to create the button for. This is the value from the Products display of the admin pages.
  • The image can be any of the PayPal images or one of your own.

Click on the following button which shows what happens when someone wants to buy from PHP-KeyCodes.

When the purchaser clicks on the buy now button, the php script will extract all the relevant data from the database and post it to the PayPal server.

Adding a text box for customer input

PayPal has a field called 'custom' which is a pass through field where any data entered into the field will be passed unchanged to PayPal and returned within the IPN.

In PHP-KeyCodes, entering text into the custom field is returned with the IPN payment details and the data is stored in the tblsaleshistory table along with all the other PayPal details and the purchased license codes.

This allows you to request details from the customer such as a customer reference number or Phone model.

To do this, add a text input box to the form field which will look like the following :


Customer input :

The code for the button is as follows :

<form action="http://www.yourservername/phpkeycodes/ipn/process.php" method="post">
<input type="hidden" name="recid" value="1">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" 
   alt="Make payments with PayPal - it's fast, free and secure!">
   Customer input : <input type="text" name="custom" class="inputbox" />
</form>

The only addition is a text input box with a name of "custom".

The custom variable has a maximum size of 255 characters.


Find out more

Pricing : PHP-KeyCodes costs $45 U.S. Dollars.
Purchase page

Demo : To view an on-line demo illustrating the admin pages. Demo page
The demo is live and you may purchase items to see how the system works. Items are $0.01 in value.

Enquiries : If you have any questions about the product, go to the contacts page.
Contacts page