World Class Web Hosting
+1.877 724-7638

my pair account webmail

Web hosting services

 

  • pairNIC - domain name registration (as low as $13/year)
  • pair reseller program - reselling our Web site hosting services
  • pair Networks does not offer "Business Associate" services under HIPAA

about pair Networks

 

Contact Us

pairNIC Support

blog.pair.com

Call Us

  • +1.877 724-7638
  • +1.412 381-7247

Fax

  • +1.412 381-9997

E-mail Us

Web contact forms

Mailing Address

  • pair Networks, Inc.
    Suite 210
    2403 Sidney Street
    Pittsburgh, PA 15203-2168

support - knowledge base

 

Authoring/Development - rand_text.pl

Homepage:

http://nms-cgi.sourceforge.net/

Modifications Required:

Yes

rand_text.pl is a script that takes text you specify and randomly displays it on your Web site. It must be copied to your own Web directory and modified for your own use.

You will normally want to place rand_text.pl in a CGI directory, although this is not strictly required (because it has the .pl extension, it will execute as CGI from any directory).

To begin, copy the script into your Web directory. Use this sequence of commands when logged in by SSH:

cd ~/public_html
cp /usr/www/cgi-bin/rand_text.pl cgi-bin/.
Next, use your favorite text editor to modify the script. You will need to set two variables within the script:

$random_file

This is the path to your text file (for example, /usr/www/users/USERNAME/example.txt).
$delimiter

This is what delimits the text in the file. For example, if you were putting quotations on your site, this is how the program will know when one quotation stops and another starts. The default is set to "%%\n", which means that in your text file you'll need to put a line between each quotation with two percents, like this:

"Something interesting"
- Some Guy
%%
"Another saying"
- Someone else

To display the quotations on your site, include this code in your HTML wherever you want them to appear:

<!--#exec cgi="/cgi-bin/rand_text.pl" -->
Since this is SSI, you'll need to make sure your HTML filename ends in .shtml, not .html. For more information, please see our article on SSI.