Installing Matt's Free-For-All Link Script
This script can be used to allow visitors to add a link to their own web page. The linkspage 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
- 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.
- Change the first line of the Perl script to reflect the official path to Perl on our server:
#!/usr/bin/perl
- 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 $linkstitl
- 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 /home/yourdo where "yourdo" is the account userid.
As such, the Set Variables section of the Links script would follow this format:
# Set Variables $filename = "/home/<userid>/links.html";
$linksurl = "http://www.yourdomain.com/links.html";
$linkscgi = "http://www.yourdomain.com/cgi-bin/links.pl";
$linkstitle = "Free For All Link Page";$database = "/home/<userid>/database.txt";
Be sure to substitute your domain name and userid in the example above. Although Matt's code is accurate, we recommend that you check the scripts for accuracy before installing them on your domain.
- Upload the "links.pl" script to your cgi-bin directory in ASCII transfer mode. You will need to chmod 755 the Perl scrip (setting the proper permissions).
- Modify the form ACTION attribute within "links.html" to reference the links script within cgi-bin as shown below and upload to your root ("home") directory.
<FORM METHOD="POST" ACTION="/cgi-bin/links.pl">
- Create an empty file named "database.txt" and upload to the root directory in ASCII transfer mode.
- Remember, links.htmlhas to have permissions set to 777 (chmod 777) to enable public write access. The same must be done for the database.txt file. 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
- You can modify the links.html file to meet your own design standards, but do NOT remove the <--XXXX--> tags which tell the Perl script where to insert new entries.
- Some possible causes of a SERVER ERROR:
- Set Variables section within Perl script inaccurate
- Perl script was not uploaded in ASCII transfer mode
- Public-write permission not set for links.html (see #6 above) - The database.txt file can be used in conjunction with Matt's Random Link script.
