CGI Scripts by Kevin

Random File Picker v1.0

In Short:

This is another very simple script which will pick a random file, given search critera (and not defining every file). Multiple searches are supported.


Click here


First, set the $BaseURL variable to "". Next add searches to $RandomArray. All searches look like this:

$RandomArray{'search'} = "ServerDir,VirtualDir,Mask"

  • ServerDir is the actual directory to look for files, ie. /home/site/www/files/
  • VirtualDir is the URL used to access that directory ie. files/
  • Mask is the filemask you want to search for ie. *.mid for only MIDI files.

    Upload to your server in ASCII mode, chmod 775. To get a random file go to Since this script uses redirects you don't need to worry about setting up mime types within the script, the server should take care of that.


    Click here

    "By downloading this script I agree to indemnify DataDragon Information Services from any damage that could be done by this script. In other words, it's my own tough cookies if this script wreaks havok on my web server."


    Location Used:
    Subscribe to List:YesNo
  •   Listing of Scripts

    Other Resources