##############################################################################
#                        SSI Random Image v1.1                               #
#                    Server Side Include Image Script                        #
#                                                                            #
#                         Scripts Archive                                    #
#                    https://worldwidemart.com/scripts/                      #
##############################################################################

DESCRIPTION
-----------
SSI Random Image is optimized for Server Side Includes. Unlike the standard
Random Image script which uses redirects, this outputs HTML directly that
gets embedded into your page by the server before sending to the browser.

FEATURES
--------
* Direct HTML output for SSI embedding
* Optional link wrapping
* Configurable image attributes
* No browser redirects needed

REQUIREMENTS
------------
* Web server with SSI support enabled
* Perl 5.x or higher

WHAT IS SSI?
------------
Server Side Includes (SSI) is a simple server-side scripting language
used to include content in web pages. The server processes SSI directives
before sending the page to the browser.

Example directive:
  <!--#include virtual="/cgi-bin/script.pl" -->

ENABLING SSI
------------
Apache configuration:

  # In httpd.conf or .htaccess
  Options +Includes
  AddHandler server-parsed .shtml

  # Or for all HTML files
  AddOutputFilter INCLUDES .html

INSTALLATION
------------
1. Upload ssi_rand_image.pl to your cgi-bin directory
2. Set permissions: chmod 755 ssi_rand_image.pl
3. Create images directory with your images
4. Edit configuration variables
5. Add SSI directive to your .shtml page

USAGE
-----
Add to your .shtml file:
  <!--#include virtual="/cgi-bin/ssi_rand_image.pl" -->

The server will replace this directive with the script output before
sending the page to visitors.

CONFIGURATION
-------------
$image_dir   - Path to images directory
$image_url   - URL path to images
$output_html - 1 for <img> tag, 0 for just filename
$img_border  - Image border (0 for none)
$img_alt     - Alt text (empty uses filename)
$link_image  - 1 to wrap in <a> tag
$link_url    - Link destination (empty links to image)

SSI VS REDIRECT
---------------
SSI Random Image (this script):
+ HTML is embedded server-side
+ No extra HTTP request
+ Works even if JavaScript disabled
- Requires SSI-enabled server
- File must have .shtml extension

Redirect Random Image:
+ Works without SSI
+ Can be used directly in <img src="">
- Causes additional HTTP redirect
- Slightly slower loading

HISTORICAL CONTEXT
------------------
SSI was one of the earliest forms of server-side scripting, predating
PHP and ASP. It's still supported by most web servers but has been
largely replaced by more capable technologies.

MODERN ALTERNATIVES
-------------------
SSI is rarely used in modern web development. Instead:

Server-side:
* PHP <?php include('random_image.php'); ?>
* Node.js with Express/EJS
* Python with Jinja2
* Ruby with ERB

Client-side:
* JavaScript DOM manipulation
* React/Vue/Angular components

Static site generators:
* Jekyll
* Hugo
* Eleventy
* Gatsby

Edge computing:
* Cloudflare Workers
* Vercel Edge Functions
* Lambda@Edge

LICENSE
-------
Artistic License

##############################################################################
