25 Years Successfully Designing, Hosting and Promoting Websites

 

XML Sitemap

Websites Online is honored to be a


And winner of the

 

Installing Matt's Free-For-All Link Script

Preface

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.

Please note that the links.pl script which accompanies Matt's Free For All Link script is rather vulnerable to bogus or undesirable posts. Some customers have stated that their Free For All Links page became flooded with advertisements. We suspect that someone has written a program to bombard the page in this manner.

The Free For All Links page has several predefined categories in which visitors can post their own link (e.g. business, computers) and it appears the offending script targets the predefined categories. It was suggested that if users change these categories, the links page should remain a bit less cluttered with unwanted posts.

 

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 /u/web/yourdo where "yourdo" is the account userid.

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

    # Set Variables
    
    $filename = "/u/web/<userid>/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 = "/u/web/<userid>/database.txt";     

    Be sure to substitute your domain name and userid in the example above. Although Matt's code is accurate, we recommend using the Perl Script checker within your account Control Panel when installing any Perl script.

  4. Upload the "links.pl" script to your cgi-local directory in ASCII transfer mode. Cgi-local will place the appropriate permissions on files uploaded to this directory so you do NOT need to chmod 755 the Perl script.
  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 root directory in ASCII transfer mode.
  7. Select the File Manager option within your account Control Panel. Locate the file name links.html . Click the box marked "PW" to the left of the links.html file name 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.

 

Take a break and have a laugh

Google+
Please contact the Webmaster with comments about this site.
Copyright © 1997-2022 by Websites Online, Inc., all rights reserved. Text, graphics, and HTML code for this site  are protected by US and International Copyright Laws, and excluding Internet search engines and directories,  may not be copied, reprinted, published, translated, hosted, or otherwise distributed by any means without permission.