Welcome to the www.dtp-aus.com LnkinLite V2.71 program.

IMPORTANT INFORMATION THAT MUST BE READ IF YOU WANT TO USE THESE SCRIPTS

The program "LNKINLTE.CGI" was written (and ©) by Ron F Woolley, Melbourne Australia.
Copyright
1998 '99 2000. This script can be altered for personal use,  EXCEPT THAT:
  ALL COPYRIGHT NOTICES must remain in the code, visible on all output pages,
  AND ALL of the header notices MUST REMAIN intact visible as is,
  AND using the script(s) without first reading the README.HTM, is prohibited.

Australian copyright is recognised/supported in over 130 countries per Berne Convention
and other treaties ( including USA! ) - copyright registration is not required!

The scripts and associated files remain the property of Ron F Woolley.
NO PROFIT what so ever is to be gained from users of these scripts for the use of these
scripts, except that a reasonable minimal charge for installation may be allowed if installing,
as a site developer, for a user on the users site that is not on / in the developers domain.
This program must NOT be used for multiple LnkinLite users on one site/domain
and the program resource must not be supplied as a remote service

Ron Woolley, the author, MUST be notified via the addresses/URLs below
if any monetary charge is applied for the installation of these scripts.

NOTE: If you use these files, you do so entirely at your own risk, and take on full responsibility for the consequences of using the described files. You must first agree that Ron Woolley / HostingNet, the only permtted supplier of this and/or accompanying files are exempt from any responsibility for all or any resulting problems, losses or costs caused by your using these or any associated files.

If you disagree with any of these requirements,
you must immediately destroy all files.

Although this program script is free to use, if you use it and find it useful, a donation to help continue this support and keep new scripts / upgrades coming would of course be appreciated.
      On line Visa / MasterCard payments are available for donations and low cost installations.

These files can only be obtained via the above web addresses, and
must not be passed on to others in any form by any means what so ever.
This does not contradict any other statements above - also ensures you have the latest.


DESCRIPTIONVARIABLES LINKS INSTALLINGUTILITIES

NEW** Version 2.71, Ferbruary 2000 **NEW
check every few months for upgrades

History....
Fixed in 2.71 - referrer checking (as an option). There was a major blooper involved for many sites wanting to protect local site link access (see next). The previous link name leading character (#) has been changed to a dot ( "." ).

Added to 2.7 referrer checking (as an option). One new variable, plus changed old variable name "$the_path" to a more correct "$the_url" name.

Added to 2.61 are aesthetic changes and javascript placement of link names / urls in editing boxes.

Added to 2.6 are the admin options to edit link URLs, and reset link counts to zero, plus create correct hyperlink tag code for easy copy and paste into html. Upgrades from v2.5 only require the uploading of "lnkinlte.cgi" (with paths etc copied from the earlier version), and the uploading of "edits.pl" - no new variables have been added.

Added to 2.5 is the ability to add and delete link names and urls via the viewer page with your browser. Several new variables have been added plus two new files. One is a 'require' file for the editing options, and the other holds an encrypted Admin password for adding or deleting links - typos fixed in 2.5b.

Added to 2.1 is the hyperlinking of installed links on the viewer page. Now you can, from time to time, test that redirected linked pages have not been moved / removed. One extra variable has been added to the script for the hyperlinking to work.


Low cost installations can be carried out by the author; see program page for details link.
This program must be compiled by Perl versions 5+, on Unix servers with Sendmail

ABOUT

All relevant files are supplied in one compressed .zip file that includes the recommended directory structure. It is assumed that the .zip file has been uncompressed to the directory structure included in the .zip file on your local computer. Then transfer of all files by FTP should ensure that correct line ending markers etc are converted during the File Transfer Protocol process.

You MUST alter the script path, the webmasters email address and the list Viewer Access Password before FTP uploading the lnkinlte.cgi script, and change the important first line call command to Perl on your server (if required - see below). One CGI-BIN sub directory plus a data file also has to be created.

LnkinLite enables you to not only supply external sources with your sites URL, but add a simple reference to the URL that will in turn update a count of each click through each time a URL is accessed. You could use LnkinLite for internal link usage counting also, but there is no security involved that ensures only your site pages are being used (instead of copies etc).

Viewing Admin - referrer checking / blocking can stop EVEN YOU!
Access the Viewing List of current count totals by calling the script with your password, from a link on a page on your site - ie a secure webmasters admin links page, NOT from a browser command line OR remote page copy. This is a simple but effective security measure.

Creating Tags - Testing Links - Admin
Viewing the link list via admin enables hyperlinks to test your links without counting (clicking the link), AND to create the correctly spelt hyperlink code (GET) for a simple copy and paste action.

This new generated window ( GET ) also includes a simple link which could be used in E-Mail letters for counted responses etc.

Via admin the links can be tested at any time without adding to the click count.

Local links ON your site can be referrer checked, blocking access from remote copies of your pages OR a browser command line.

Editing Links - Admin
Clicking on the "ED" option (appearing next to the "GET" option) places the link name and URL in the editing boxes, saving the previous need to manually enter or copy link data to the editing form.

CALLING THE VIEWER / EDITOR using the PASSWORD
<a href="http://yourdomain.name/cgi-bin/lnkinlte.cgi?p=
password">View Log Data</a> NOTE: The links are called with ?l=***. The password is called with ?p=***.

I have included an example 'lnkinlte.dta' file for you to configure and up load to the "lnkinlte" sub directory (default). In this file you will identify three example links, and they include the special "|" vertical line character. The item pattern is as follows: Name|Link|Count, ie
"
widget|http://www.widgetstuff.com/|0".
The third item, the count value must be set initially to zero "0". You can configure as many link click records as you wish, but do not apply them to all of your links just because you can. This is an excellent way of analysing how many visitors leave your site to other sites you link to, plus (and the main purpose of this script) supply a URL with the lowercase "l" option to banner ad organizations and reciprocal link sites so you can also track the click throughs back to your site your self.

The second item in each record between the vertical line " | " characters is the URL the script is to send the person to once the click (script access) has been recorded

Please NOTE:
If you install and use this script, please contact us at lnkltereport@dtp-aus.com with server type details and how the script installed and worked etc, for our report base.
( a vote at cgi.resourceindex.com - via red form on the LnkinLite program page - or any other cgi links site would also be appreciated to help "spread the word" )
  Thank you.

For INTERMEDIATE installation experience - Help / Advice information is available.

The CONFIGURATION VARIABLES in DETAIL

You must adjust the variable values included at the start of the script just below the header. Of these the second, third and last (shown in blue) should be left as is for a recommended setup ie.

#-------- ALTER THESE VARIABLES ONLY! --------------------------#
$the_url = "http://
yourdomain.name/yourcgi-bin/lnkinlte.cgi";
@referers = ('www.yourdomain.name','yourdomain.name');
$records = "
lnkinlte/lnkinlte.dta";
$edit_subs = "
lnkinlte/edits.pl";
$webmsta = "
webmaster\@yourdomain.name";
$myword = "
yourpassword";
$admwrd_pth = "
lnkinlte/lnkinlte.pw";
#-- YOU SHOULD NOT MAKE ANY CHANGES BELOW THIS LINE. -----------#

URL TO THE SCRIPT
For the "broken hyperlinks" checking facility, the script has to write the full URL to its self. Where shown in red above, change:
$the_url = "http://yourdomain.name/yourcgi-bin/lnkinlte.cgi";
to the correct URL for the script in your CGI-BIN.

If occasionaly checking for broken links via the links list viewing page, clicking on the listed URLs will open a second browser window, leaving the list on screen underneath. Testing with this option will not add any click-through counts to the records.

CHECKING FOR CORRECT REFERRERS - Bad Referrer, Access Denied!
NOTE: THIS METHOD only applies to accessing the admin page OR the link naming option of placing a dot "." character as the first character of any link name!

This option in the script allows you create an "array" of Domain names and IP numbers that jmpncnt.cgi will respond positively to. By including the acceptable calls to your pages and/or your IP#, ie 'www.yourdomain.com' and ‘yourdomain.com' you effectively stop improper use of your lists and admin from distant sites (entries are only accepted from your site, not remote copies of your pages elsewhere – they try all the time). The array is named "@referers" and you simply (MUST) enter your preferences in place of the examples. NOTE: The brackets, quotes and commas enclosing each item must be included else an error will occur, ie:
('www.yourdomain.com','yourdomain.com','000.000.000.000',)
Leave out the IP# if you do not have a true domain name with a static IP#. "www.ahost.net/mysite/" etc will also work for second level site calls etc. This is a first level security feature.

This will block acces via a browsers command line AND remote copies of pages containing links to the program - EVEN YOU !!

At this point I will bring your attention to the semi colons ( ; ) appearing at the end of each variables. These MUST remain else an error will occur.

PATHS TO FILES ACCESSED BY SCRIPTS
The script must know where to find the data file where you enter each new link NAME and URL.
$records = "lnkinlte/lnkinlte.dta"; is the default and recommended relative path to the links data file. It is this file that you must add each link to as described below (if manually adding).

This script uses a 'require' file when the viewing and editing page is loaded.
$edit_subs = "lnkinlte/edits.pl"; is the default and recommended relative path to the reqire file. Do not edit this file.

This script uses a different password for editing - the "admin" password.
$admwrd_pth = "lnkinlte/lnkinlte.pw"; is the default and recommended relative path to the encrypted admin password. Do not edit this file. The program will allow you to add / change this password via the editing page.

NOTE: Double check ALL permission's (below) before changing the default paths. Unless you know in advance through experience what the paths could be, do not change the default.

WEBMASTERS E-MAIL ADDRESS
The script will report errors it detects. When it does, the error window will display your webmasters e-mail address for contact if an error persists.
$webmsta = "webmaster\@yourdomain.nme"; is the variable you must alter (ONLY between the quote marks ( "....").

NOTE: The backslash ( \ ) is very important for Perl 5 users. All string references that include the @ character must insert a backslash before that character.

ACCESS PASSWORD
You must call the script with the "p" option to view the current link counts on the editing page. With the "p" option you just include your access password as you would a link name.
$myword = "yourpassword"; is the variable you must change (ONLY between the quote marks ( "...."). This is the viewer/editing page access password.

ADMIN PASSWORD
Once in the editing page, you can create a new admin password also. When this has been created you will have to include the admin password for the script to accept changes/additions (
the script does not have an admin password set up when first installed).


LINKS

The Admin page can be used to generate each link tag (via a new window) with a simple click for a "copy & paste" of the tag into html code. The "GET" hyperlink to the left of each link data line will do that. Next to the GET link is a simple JavaScript link ( "ED" ) which places the relevant link name and URL in the edit boxes. So the following are descriptions of how the link set-up works.

LINK USAGE RECORDS and HYPERLINK CALLS
The data file is also used to log the number of times visitors use specific hyperlinks in to your web pages. Both links from one page to another local page, or links to or from other sites can be included. Each different call is a simple change to the "A HREF tag that you wish to track, ie:

<a href="http://yourdomain.name/cgi-bin/lnkinlte.cgi?l=3">hyperlink</a>
   or
<a href="http://yourdomain.name/cgi-bin/lnkinlte.cgi?l=.jimbo"><img src....></a>.
   or
<a href="http://yourdomain.name/cgi-bin/lnkinlte.cgi?l=testlink2"><img src....></a>   as you will see as a sample in the 'lnkinlte.dta' file.
etc...

NEW v 1.7 By adding the "." character as the FIRST character of a link name then that link will be referrer checked - IF wanting to confine link access ONLY via pages ON your site ( and not remote copies OR browser command lines ).MENU

If sending a link URL to someone placing a link TO your site FROM theirs, create the link via admin as explained here and then send them the full URL with the new linkname included as above.

Note: The link name (l=??? ) should only be ONE WORD. If not, Netscape may respond with an error.

HOW
Version 2.5 introduces the ability to add and delete link details via the editing page loaded with the "p=password" option explained elsewhere. However, should you for any reason need to manually adjust the data file, here is an explanation of the data file fields.

In the three examples above, the question mark denotes the start of the query string that follows it. The "l" is a lowercase "L", NOT a numeric 1. The "l" tells LnkinLite to handle the query as a hyper(l)ink. After the "=" sign is a number in the first example and a word in the other examples. I have shown this so you can see that this is indeed a name, and numbers could be used while words would be more descriptive. The name should refer to an identical name entered in the link list data file, 'lnkinlte.dta'.


For INTERMEDIATE installation experience - Help / Advice information is available.

INSTALLING

A utility script, makedir.cgi, is included to automatically setup the required sub directory of your CGI-BIN and create an empty data file ready for you to upload (ASCII format) the sample that can be used for testing. This script is set up ONLY for the recommended default directory structure see below.

For those users with little experience installing Perl CGI scripts, I have also included a utility script that can be easily installed first and run to test the path to perl and the perl version your server is running by default. THIS SCRIPT IS FOR PERL 5+, ON A UNIX SERVER USING SENDMAIL.

THE PATH TO PERL
At the top of each script (and must remain as the first line) is a default path to the Perl program on your host server. This can vary slightly between UNIX servers. If you have problems running the scripts, check with your host support staff about the correct path described in this line. The default entry is "
#!/usr/bin/perl" and another common variation is "#!/usr/local/bin/perl". In Perl scripts the hash sign "#" character comments out the code on a line starting with this character. Here it has a special meaning to Perl.

FILE PERMISSIONS
Upload the scripts via FTP. The Link List file, lnkinlte.dta, needs to be created by you because and you will have to enter your links and their names after testing (see below). The scripts MUST be given read/execute permissions, chmod 755, and placed in the CGI-BIN. The data file must be given read and write permissions (chmod 766). The directory that it is placed in will also have to have read and write permissions. Either read and write chmod 766 (r+w) or possibly chmod 777 (r+w+x) will work - try the first before the latter.

UP LOADING FILES (Posting)
CGI-BIN permissions are set by the server and no attempt should be made to change them. Should you have to use another directory, AND your server allows the execution of Perl CGI scripts in other directories, then that directory should be set with read and execute permissions - chmod 755 (r+x). Also, The scripts should be set to chmod 755 (r+x).

By far the biggest problems faced when installing scripts are firstly the file transport encoding used and secondly the permissions settings set for both files and new directories. Bitmap images must be sent to the server using the "Binary" protocol. Text files, ie html pages, CGI SCRIPTS, text data files, and require files, MUST be sent in "ASCII" format. Failure to do this will result in a server failing to recognise and execute the scripts. Although often referred to as programs, scripts must be compiled before they do anything. As an example, files with the .EXE extension on programs that are installed on Wintel machines are pre-compiled binary executable programs. Perl scripts on the other hand are compiled in memory by Perl before they can be executed. The script (text) must be in ASCII text format for the interpreter to be able to read it.

REPEAT: Up load scripts and text files as "ASCII" files, images as "Binary".


So, assuming the default directory structure is used, you will up load into:

Directory:
cgi-bin (server)
lnkinlte.cgi, (chmod 755)
makedir.cgi, (chmod 755) utilty
testbin.cgi, (chmod 755) utility
cgi-bin/lnkinlte (chmod 766 or 777) - must be readable/writeable
lnkinlte.dta (chmod 766 or 777)
edits.pl (chmod 766 or 777)
lnkinlte.pw (chmod 766 or 777)

A Link to the LNKINLTE.CGI count viewer/editor page
<a href="http://yourdomain.name/cgi-bin/lnkinlte.cgi?p=password">
View Log Data</a> NOTE: The links are called with ?l=***. The password is called with ?p=***.


UTILITIES

Webmasters Page - the 2 methods to Admin
I have supplied a sample webmasters page ( webmster.html ) that can be used to access the admin page, or copy the required link (form or hyperlink) to your own webmasters utility page. You will have to change the path in the links to suit your own. This page should ideally be placed in a secure directory. If not, use the form method of accessing admin and DELETE the hyperlink. Else if secure you can use the simple link with the embedded password.

UTILITY testbin.cgi
I have created a simple utility script that can be placed in your cgi-bin and run from your browsers command line. This script will, in almost all cases, detect the Perl version you are using and report its findings. If it reports version 4 as the only default, then you must ask your Host Service for the correct path to Perl 5 (Always top and FIRST line in all scripts). LnkinLite is a Perl 5 script for Unix servers.

The new version of tesbin.cgi attempts to ascertain server paths to all Perl versions and paths to Sendmail. Either or both of these may not be listed depending on server set-up. Testbin.cgi also now allows you to check your path to perl by attempting a mail out. To do this change in the code near the top the URL to the testbin.cgi program.

So!
Change the program URL in the code - only variable to change.
Place "testbin.cgi" in your cgi-bin directory and chmod 755 (7=r+w+x, 5=r+x).
Then run from a browser command line, ie http://www.yourdomain.path/cgi-bin/testbin.cgi

UTILITY makedir.cgi
I have created a simple utility script that can be placed in your cgi-bin and run from your browsers command line. If your server allows directory creation via cgi scripts, then this utility will attempt to create the default (recommended) directories and file names for you, and set the permissions. It is unprotected and there is no guarantee that it will work; try it at your own risk (disclaimer only). It has worked well on many sites.

Try installing and running this script first. It will report success or failure when creating the files/directories and prove the correctness of your Perl Path", plus indicate that the default relative paths will work OK. If the default urls/paths are not used, then you will have to change them first.

To use it, make sure the "Perl Path" at the top of the script is correct. NOTE: the default Dir/File permissions are set to 766. Change these values to 777 if your site so requires BEFORE running the script. If running the script is successful, you only have to FTP your supplied files over the new empty ones. (note: for security reasons, makedir does NOT prepare an empty file for the cgi scripts, you must upload them (as ascii) and set chmod 755 your self)

Once run, delete the file immediately because it has no input protection and could be run again by some low-life wanting to cause mischief

So! Place "makedir.cgi" in your cgi-bin directory and chmod 755 (7=r+w+x, 5=r+x). Then run from a browser command line, ie: http://www.yourdomain.path/cgi-bin/makedir.cgi

Enjoy - & please let me know how you get on with this script, how/what server type it installed to.
      Ron