Refer The World Version 1 Setup Guide.
©2001 Justin M. Clark
We do not permit you to edit, reconfigure, or re-engineer this script in any other way than the following fields below. We do offer custom versions of this script, if there is an option that you see missing, or would like to change something, please contact us first at perl @ MyDesktopHelp.Com
If you have edit the script and it no longer works, we will look over the script and troubleshoot it for free as long as we are only making sure that your values are set correctly. However if we have to edit or reconfigure any other part of the script (unless it is an original error in the script) it will be at a rate of $50/hour in one hour increments. The first hour will be paid before any services are rendered.

Requirements:

RTW requires very little setup and configuration. First, RTW requires Perl 5 to be installed on the server. Also, in order for the email functions to work, the libnet Net::SMTP module or sendmail (if on Unix Host) must be installed in the server. Net::SMTP is a very common module and comes bundled with the latest release of Perl 5. 

Setup:

There are 12 settings that need to be configured in the script. First open the script in notepad or WordPad, then configure the following settings:
All values must be preceded with "my" and surrounded by quotation marks unless otherwise noted.
All real paths must use "/" instead of "\" for example, if you use "c:\data" instead of "c:/data" the program will not work. Also, please do not enter "/" after the directory.
And All fields need to be defined unless otherwise specified.

my $datadir="c:/datadirectory";
This is the real path to dir where user info is stored, i.e. "c:/datadirectory" must have "change" or read-write-execute-delete access for everyone

my $prog='"http://www.domain.com/cgi-bin/refer.pl"';
This is the URL to this script, notice that it is surrounded by a single quote ' and a double quote ". This must also contain the "http://"

my $relay="mail.domain.com";
This is your SMTP server i.e. "mail.domain.com" UNIX users will have the $relay value replaced with $mailprog which is the path to sendmail.

my $title="My Domains Referral System";
This is the title that will appear on top of all pages in the referral program.

my $target="http://www.mydomain.com";
This is the page that you would like the referral program to refer the users to when he clicks on the referral link in the email. 

my $quota="5";
This is the number of referrals required before you are alerted. You may set this to a extremely high number if you are using this as a referral program only and not to give rewards for user referrals.

my $administrator="WebMaster";
The name of the person running the script. i.e. "Webmaster" or "John Doe" This will appear at the bottom of every page with a link to your email address.

my $adminemail='WebMaster@mydomain.com';
The email address of the person to alert when a user refers the quota you set above, also the email link at the bottom of every page when the user clicks on the name you setup above in $administrator. Surrounded by singe quote '.

my $donedir="c:/datadirectory/done";
The directory where users are put once they reach the referral quota. Must be different that $datadir and must have "change" or read-write-execute-delete access for everyone.

my $backimage="";
URL to the background image if you would like to supply one, i.e. "http://www.domain.com/images/background.jpg" This field is not required.

my $backcolor="#FFFFFF";
the color you would like your background color to be. i.e. "navy" or "#000080" Should be supplied at least white so that you wont conflict between different browsers. For example, if you leave this setting blank, in IE background will appear as white, in Netscape it will appear black.
Here is a table that gives a list of common colors, I would recommend entering the "#FFFFFF" value instead of just the name of the color.
#FFFFFF=White
#000000=Black
#008000=Green
#000080=Blue
#FF0000=Red
#FFFF00=Yellow
#FF6600=Orange

my $fontcolor="#FFFFFF";
the color you would like all fonts and horizontal lines to be. i.e. "navy" or "#000080" Should be supplied at least white so that you wont conflict between different browsers. For example, if you leave this setting blank, in IE background will appear as white, in Netscape it will appear black.
The table above works the same way with this value, I would recommend entering the "#FFFFFF" value instead of just the name of the color.


Also, there is a file called body.txt This must be located in the $datadir folder. You may also edit this text document to the message that you would like the referral to see. There is 3 fields in the document that must be there and will be replaced by the script when the email is sent. A description follows:
<--toname--> This is the name of the Person that the referral is being sent to.
<--link--> This is where the referral link will be placed in the email.
<--fromname--> This is the name of the person that referred the user.
All 3 fields are case sensitive, so be careful when retyping or the person will receive the wrong email.

An example of the file is here:

Dear <--toname-->,

I found this great site today, it's called MyDomain.com.
They have lots of things you would be interested it.

Go check it out by clicking here:
<--link-->


Your Friend,

<--fromname-->

Now, lets say that George is referring Bob, when the email is sent, it will look like this:

Dear Bob,

I found this great site today, it's called MyDomain.com.
They have lots of things you would be interested it.

Go check it out by clicking here:
http://www.mydomain.com/...


Your Friend,

George


Using RTW:

1. Setup all the variables above.
2. Test the script by referring yourself
3. type in the URL to the script and add ?admin to the URL This will ask you to set a password. please remember this password, and it is case sensitive.
4. Then return to the ?admin page and enter your password you just set.
5. This page will allow you to view all users who have referred someone, and who they have received credit for as well as what users have met the referral quota.
6. Once you have contacted a user to tell him that he has reached his quota, it would be wise to go to the $donedir and delete the 2 files with the users email address.
For example, if the user was bob@yahoo.com there will be 2 files, bob@yahoo.com and bob^yahoo.com
in the $donedir that you can delete. It is not a requirement that this is deleted. but it will save space on your server.