===========================================================
  POST Affiliate version 1.3
  Copyright (C) 2003
  Maros Fric, webradev.com   <info@webradev.com>

  Official Website: http://www.webradev.com/postaffiliate/
  Support:              via email
===========================================================                      
 
Thank you for downloading POST Affiliate version 1.3

THE USE OF THIS SOFTWARE IS COMPLETELY AT YOUR OWN RISK!

--------------------------- GNU License ---------------------------

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

------------------------------------------------------------------------------



------------------------------------------------------------------------------
WHY POST Affiliate & History
------------------------------------------------------------------------------
When I was looking for free PHP scripts for affiliate system, I found out 
PHP-Affiliate (version 1.2). Firstly I wanted just to customize it and use it,
but soon I realised it is a code of poor quality. It is based on good ideas which
can be reused, but the code had to be rewriten from a big part. 

So I improved the code, corrected major security holes and other problems. 
It took me 2 days to come out with first version of POST Affiliate, and this is 
the result.  

It has the same set of features as PHP_Affiliate and some advantages:
- can work if register_variables is Off
- few security fixes (some of them serious)
- better basic design
- better logic and action flow


------------------------------------------------------------------------------
CHANGELOG
------------------------------------------------------------------------------
Changes in POST Affiliate 1.3
- added configuration option for cookie expiry, path and domain
- corrected check1.php to not exit if no referrer is present
- added debug message option to check for errors when registering sales
- added support for more languages:
    - swedish (sve.php) by Therese S <tessan_sthlm60@hotmail.com>
    - french (fr.php) by RW Media <regisw@rw-media.be>

Changes in POST Affiliate 1.2
- corrected bug that caused that the country was not changed in user profile
- corrected small bugs when displaying text in clicks and sales page

Changes in POST Affiliate 1.1
- corrected small bugs
- added support for more languages:
    - italian (it.php) by Luca S. <elsombrero@libero.it>
    - chinese (big5.php) by Peter Kuo <service@iwcash.com>
    - german (deu.php) by Vllig Unerwartet <unerwartet@austromail.at>


------------------------------------------------------------------------------
How to change default language in POST Affiliate:
------------------------------------------------------------------------------
- it is relatively simple, you only have to edit file affconfig.php, and set
$language to the name of language file.

Example:
$language =  "big5.php"; // for chinese
or
$language =  "deu.php"; // for german
or
$language =  "it.php"; // for italian


------------------------------------------------------------------------------
UPGRADING FROM PHP AFFILIATE v1.2
------------------------------------------------------------------------------
There was no change in database so far, so just copy the scripts. Of course you 
should backup first.
The header and footer files were renamed from header.290, footer.290 to
standard header.php, footer.php. Admin has its own set of header and footer files.
There will be some changes in database in the next release in order to make some 
new features (see TODO)

UPGRADING FROM PREVIOUS VERSIONS OF POST AFFILIATE (1.0 or 1.1)
- just replace the scripts. Don't forget to keep your old affconfig.php sile with valid configuration, and language file (if you made some changes there).


------------------------------------------------------------------------------
TODO
------------------------------------------------------------------------------
- history of sales and click throughs
- confirmation on serious actions (such as delete)
- better security
- multi language support
- admin can change password
- mass emails to affiliates
- dynamic configuration of amounts, etc.

All those features and much more are implemented in commercial version - 
PostAffiliate Pro (http://www.webradev.com/postaffiliatepro/)
If you want to start serious affiliate program, I advice to use commercial version.
It is possible to upgrade from free version to commercial version without 
loosing any data.


------------------------------------------------------------------------------
REQUIREMENTS
------------------------------------------------------------------------------
- PHP 4 or higher 
- PERL regular expressions support for PHP - it is part of PHP installation in 
  majority of cases
- MySQL


The program has been tested on UNIX (BSD) and Windows plaforms, and should 
work on all platforms where PHP and MySQL are running.


------------------------------------------------------------------------------
INSTALLATION
------------------------------------------------------------------------------
- download and unzip the scripts

- create MySQL database and it's contents.
  Assuming you have phpMyAdmin installed:
  - Copy the contents of database.sql
  - Paste it into the text box on phpMyAdmin underneath "Run SQL query/queries on database affiliates:"
  - Press 'Go' and the tables will be created for you.
  - Change password of admin;
    -- type the following into the same box: ('newpassword' should be your new admin password
      UPDATE admin set pass = 'newpassword' where user = 'admin';
  - Press 'Go' again and the password will update
  
- open the 'affconfig.php' file in your favourite text editor 

	- For $domain, replace "www.domain.com" with the web address to your site.
	  eg. We would put "www.organicphp.com", you could be "example.domain.com"
	  or "www.domain.com/~you". Do not end with a forward slash (/) or start with
	  "http://"

	- For $server, replace "localhost" with the address to your MySQL server.
	  It is nearly always "localhost", although check with your host if unsure.

	- For $db_user, replace "username" with the username you have made or have been
	  given for your MySQL database.

	- For $db_pass, replace "password" with the password you need to access your MySQL
	  database. Make sure you give the username a password, or anyone can enter and
	  change your database.

	- For $database, replace "affiliates" with the name of your MySQL database, this
	  could be anything, it's up to you (or your host!)

	- For $currency, replace "UK Pounds" with the currency that you will be paying your
	  affiliates in. e.g. US sites may enter "US Dollars".

	- For $emailinfo, replace with your email address.

	- $yoursitename is simply your site name

  - $lang is 'eng.php' - there will be support for multiple languages later
  
	- Save these changes and exit the file

  
- Next open the file 'check1.php' in your favourite text editor
	- For $payment, replace "5.00" in variable $payment with the amount you would like to pay 
    your affiliates for every successful sale that they have sent you.
	  If you would like to pay different amounts for different products, duplicate the
	  'check1.php' file making files 'check2.php', 'check3.php' etc. and enter the
	  different payment amounts in each.
  - !!!SECURITY WARNING!!!  for security reasons, you should rename files check1.php, check2.php 
    etc. into meaningless random generated names (for example v1df23gfd3.php). It will protect you 
    from too smart     affiliates that would like to add more sales than they originally make. 
    If your affiliates know that you are using POST Affiliate, or PHP Affiliate!, they can guess 
    you are using files check1.php, etc. from standard installation, and invoke 
    script check1.php manually. The script will add non existing sales to the database.
    That's why you should rename those files (only check1, check2, ...) into hard-to-guess meaningless names.
    

- Open your main page (most probably 'index.php') in your favourite text editor
  - main page must be PHP script

	- Enter the following code above the <html> tag and any other code:
	  <?PHP include "affiliate.php"; ?>

	- Save the changes and exit the file

- Upload all of the files in their present directory structure to your hosting account,
  using your preferred FTP program. The files and folders must be uploaded into the
  Document Root where your HTML files are.

- To reward your affiliates you need to add the following line to the top of your order confirmation page:
  <?PHP include "check1.php"; ?>
  
  !!!SECURITY WARNING!!! as mentioned before you should rename file check1.php into meaningless name, lets 
  say 'hfgjsdgfjhsdg.php'. Then you should add line <?PHP include "hfgjsdgfjhsdg.php"; ?> not 
  <?PHP include "check1.php"; ?>
  
  Dont copy this example of meaningless name. Make your own!!!
  
  
  By adding this code to the page after an order has been submitted, you prevent affiliates
  from being awarded from people just going to the order page.
  Remember that you will need seperate order forms or confirmation pages if you want to
  award affiliates with different amounts.

- If you wish to customise the look of POST Affiliate, replace the HTML in the files
  header.php and footer.php from the 'user' directory, in your favourite text editor.

- Installation is now complete!


------------------------------------------------------------------------------
THE USE OF POST Affiliate
------------------------------------------------------------------------------
Users can sign-up to your affiliate program by going to:
http://www.yourdomain.com/user/signup.php

They can view their statistics at:
http://www.yourdomain.com/user/index.php

Their links to your site will be as follows:
http://www.yourdomain.com/index.php?ref=username (where 'username' is their username)

You can manage your affiliate system at:
http://www.yourdomain.com/user/admin/index.php

If you have not changed the password in the MySQL database yet, the password is 'pass456'.


------------------------------------------------------------------------------
GETTING HELP FOR POST Affiliate
------------------------------------------------------------------------------
You can send me email to info@webradev.com. For non-commercial support I cannot guarantee 
I'll answer on time or at all, but I'll try my best.

If you need help with integrating POST Affiliate or adding new features and you are willing 
to pay for it, contact me by email.








