Facebook

Installing Matt’s Free-For-All Link Script

NOTE: This is legacy information that may no longer be relevant to modern website development.

This script can be used to allow visitors to add a link to their own web page. The links page displays each link by category which makes finding a site of interest easier than reviewing a single list. A database file is also maintained for use with Matt’s Random Link script.

Installation Procedure

1. Locate and download the following files from Matt’s Script Archive:

links.pl – The Perl script that adds the links.
links.html – The HTML file containing the form and links.

2. Change the first line of the Perl script to reflect the official path to Perl on our server:

#!/usr/local/bin/perl

3. There are a few more things that need to be changed in the Perl script:

# Set Variables

$filename – The system location of your links.html file
$linksurl – The URL of your links.html file
$linkscgi – The URL to the CGI script
$linkstitle – The desired links page title
$database – The system path to the database file

The first and last variables call for a system path which is not the same as a URL. If your domain name was yourdomain.com the system path would be /sites/<domain>/htdocs/
where “<domain>” is your domain name without “www” ie. mydomain.com..

As such, the Set Variables section of the Links script would follow this format:

# Set Variables

$filename = “/sites/<domain>/htdocs/links.html”;
$linksurl = “http://www.yourdomain.com/links.html”;
$linkscgi = “http://www.yourdomain.com/cgi-local/links.pl”;
$linkstitle = “Free For All Link Page”;
$database = “/sites/<domain>/htdocs/database.txt”;

*Be sure to substitute your domain name in the example above.

4. Upload the “links.pl” script to your cgi-local directory in ASCII transfer mode. Make sure your permissions setting for this file is 755 -rwxr-xr-x

5. Modify the form ACTION attribute within “links.html” to reference the links script within cgi-local as shown below and upload to your root (“home”) directory.

<FORM METHOD=”POST” ACTION=”/cgi-local/links.pl”>

6. Create an empty file named “database.txt” and upload to the /htdocs directory in ASCII transfer mode.

7. Change the file permission for both links.html and database.txt to “Public Write”. This will allow the Perl script to append data to the file links.html .

You can test the script by referencing the links.html file via the web.

Special Notes