Email :

Installing PHP-KeyCodes ....

The following describes how to install PHP-KeyCodes for the first time. The process is simple and should take just a few minutes.


  • PHP 5 and above
  • Apache web server
  • mySQL database version 3.23 or higher
  • Linux, FreeBSD or Windows operating system on the web server
  • A Paypal Business or Premier account - sign up here.
  • Email functionality on the web server so that the PHP scripts can send out emails to customers.
  • If you are looking for a suitable host for you site, I would recommend the basic web hosting plan from siteground which has all the required features for this application.

Unzipping the files

The files are supplied in .zip format. After unzipping the files you will have a folder called 'phpkeycodes' containing a number of files and folders. It is usual to copy the whole folder on to your web server in which case the site will be located at

If you do create a folder called 'phpkeycodes' on your web server, remember to use lower case as Linux is case sensitive.

Note that Godaddy hosting requires a small script modification as described here

Site structure

Here is a quick summary of the 'phpkeycodes' folders :

folder /admin - code to administer the application

folder /classes - object classes used in the application

folder /functions - miscellaneous functions

folder /images - graphics

folder /ipn - PayPal ipn scripts

folder /ipn_sandbox - PayPal ipn sandbox testing scripts

folder /ipncommon - common ipn functions

Create a mySQL database with cpanel tutorial (old style)

Click here for a tutorial.

Create a mySQL database with cpanel tutorial (new style)

Click here for a tutorial

Create a mySQL database with GoDaddy hosting tutorial

Click here for a tutorial.

Create a database

Create a new empty database with an appropriate name (e.g. phpkeycodes).

If you are using a hosting company, then you will probably be given a control panel to access your databases system. For mySQL this is usually phpMyAdmin which allows you to administer the database via a web browser.

Quite often hosting companies will prefix the name of the database with your login name. So when you enter key codes, it becomes paul_keycodes for example.

You can install into an existing database if you wish. The table names are all prefixed by ipn_. First check that there are no other tables in your database that start with ipn_ to make sure that there are no name clashes.

Create a user for the database

Create a user (e.g. keycodesuser) that has access to that database and that database only.

If you are using a hosting company, there will probably be an administration page which will allow you to create database users, define their permissions and add the user to your database.

Quite often hosting companies will prefix the user name with your login name. So when you enter phpkeycodeuser, it becomes paul_phpkeycodeuser for example.

In the first instance, you need to make sure that the user has permissions which include CREATE privileges because the first script that you run will be creating tables in the database. Normally you will select the All Privileges option for this.

Run the install.php page

The install.php page should be accessible at :

When you display this in your web browser, it will ask for host name, database name, username, password and table prefix.


The above image shows the default display.

The host name will usually be localhost, the database name will be whatever you have already created, usually phpkeycodes. Enter in a user name and password for a user who has table creation privileges. The table prefix is normally left blank. It is used to give each table name a prefix such as v5. The allows you to have multiple versions of the application in one database.

Click on 'Create' and the script will display a list, which should all be green to indicate success. Any failures will be indicated in red.

If all are green, then all tables have been created.

Edit config.php

The config.php file contains the database connection username / password for the application.

Edit the config.php file with a text editor such as Notepad. Do not put any spaces, blank lines or other text after the last ?> symbol or before the first <?php symbol.

You need to enter :

database host name (usually localhost, but see your hosting documentation for this)
database name
database username
database password

Note that the database name, and database username may have been given a prefix by the host system.

Modifications to your PayPal account

If you have not enabled IPN in your PayPal account, you do need to enable it so that your PayPal account sends back the IPN.

  • Log into your PayPal account and click on 'Profile' on the menu.
  • Click on 'My Selling Preferences'.
  • For 'Instant payment notifications' click on 'Update'.
  • Enable the IPN.

In the url box, enter the confirm.php url which will be This url is not actually needed because PHP-eSeller sends the url to PayPal anyway.

If the url box is already being used, you do not have to change it because PHP-eSeller sends the url to PayPal anyway.

Modification for GoDaddy Hosting

GoDaddy servers require a slight modification to the script because of their security system. In the folder 'ipncommon', remove the existing file 'com_ipnfunctions.php' and change the file name 'com_ipnfunctions_godaddy.php' to 'com_ipnfunctions.php'

Set up

The application should now be working correctly and you can go to the admin pages using :

The default login is user : admin, password : admin

You should change your password and user name as soon as possible via the 'change password' page.

Usernames and passwords are located in tblusers which you may modify directly if you have access to a web interface to your database. Note that passwords are encrypted using MD5 and you should only use characters 0-9 and a-z and should not be more than 10 characters long.

User names should are restricted to characters 0-9, a-z, @ and full stop.

Display the buy now buttons

Examples of how to display your products onto a web page are explained on the following associated pages :

Buttons added by hand to your web pages

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