Q1: How do I add images to the rotation?

Answer

To add images to the rotation, edit the @images array in the script:

@images = (
    "/images/banner1.gif",
    "/images/banner2.gif",
    "/images/banner3.jpg",
    "/images/banner4.png"
);

Or use automatic directory scanning:

$image_dir = "/home/user/public_html/images/";
$image_url = "/images/";

Supported formats:

  • GIF (.gif)
  • JPEG (.jpg, .jpeg)
  • PNG (.png)
Tip: Use consistent image dimensions for a clean layout.
Back to Random Image FAQ