World Class Web Hosting
+1.877 724-7638

my pair account webmail

Web hosting services

 

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_image.pl

Homepage:

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

Modifications Required:

Yes

rand_image.pl takes images you specify and randomly displays them 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_image.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_image.pl cgi-bin/.
Next, use your favorite text editor to modify the script. You will need to set four variables within the script:

$use_redirect

You can set this to either 1 or 0. If set to 1, you'll be using the full URL to the images. If set to 0, you'll be using the full file path.
$baseurl

If you have set $use_redirect to 1, fill in the URL of the images here (for example, http://www.example.com).
$basedir

If you have set $use_redirect to 0, fill in the full file path to your images here (for example, /usr/www/users/USERNAME).
@files

Fill in the names of all of the image files here. Make sure you remove the example file names, foo.jpg and bah.png.

Once you've made these changes, you can use the script in your HTML as if it was an image:

<img src="/cgi-bin/rand_image.pl">