Installing PHP-IPNMonitor ....
The following describes how to install PHP-IPNMonitor for the first time. The process is simple and should take just a few minutes.
Requirements
- PHP version PHP 4.1.0 or higher (including PHP5)
- Apache web server
- mySQL database version 3.23 or higher
- Recommended Linux or FreeBSD operating system but will work on Windows operating system
- A Paypal Business or Premium 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 LunarPages 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 'ipnmonitor' 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 http://www.yoursitename.com/ipnmonitor/.
If you do create a folder called 'ipnmonitor' 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 'ipnmonitor' folders :
/admin - code to administer the application
/classes - object classes used in the application
/download - customer login pages
/functions - miscellaneous functions
/functionscart - miscellaneous functions for the template cart system
/images - graphics
/ipn - PayPal ipn scripts
/ipn_sandbox - PayPal ipn sandbox testing scripts
/ipncommon - common ipn functions
/pat - the patTemplate files
/templates - the folder where the templates are located
/files - a number of test files which can be used to test the download process.
Files folder
The files which you are going to sell and allow customers to download, should be placed in a location outside the root of your web site and on the same web server. This is so that no one can get to you files using a browser.
If you cannot place the files outside your web site root, then you can protect them using a .htaccess file. I have provided a number of test files in the /files folder along with a .htaccess file. The .htaccess file will deny all attempts to access the folder using a web browser.
Create a database
Create a new empty database with an appropriate name (e.g. ipnmonitor).
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 ipnmonitor, it becomes paul_ipnmonitor 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. ipnmonitoruser) 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 ipnmonitoruser, it becomes paul_ipnmonitoruser 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.
Run the install.php page
The install.php page should be accessible at :
http://www.yoursitename.com/ipnmonitor/install.php
When you display this in your web browser, it will ask for host name, database name, username, password and table prefix.
The host name will usually be localhost, the database name will be whatever you have already created, usually ipnmonitor. 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 already have created a user, but that user may have full privileges which includes CREATE, DROP, INDEX and ALTER. The config.php file does not need a user with full privileges, it only needs a user with SELECT, INSERT, UPDATE, DELETE privileges.
So create a new user with just SELECT, INSERT, UPDATE, DELETE privileges and edit config.php to define the host, database name, and the username and password.
If you don't understand what I am talking about, don't worry, just use the same user name / password that you created for use with install.php. This is just a good practice security issue where you give the user only the privileges that they need.
Modifications to your PayPal account
You do NOT have to make any changes to your PayPal account.
Set up
The application should now be working correctly and you can go to the admin pages using :
http://www.yoursitename.com/ipnmonitor/admin/
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 and add to cart buttons and login page
Examples of how to display your products and how to place the login page onto a web page are explained on the following associated pages :
Buttons added by hand to your web pages

