Solved

CGI for Midis?

Posted on 1998-02-12
1
247 Views
Last Modified: 2013-12-25
I would like to have a random midi play on my webpage when someone visits it.  Is there a cgi out there or someway to do this?
0
Comment
Question by:treyjeff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
cfrericks earned 50 total points
ID: 1831985
you don't need to use cgi to do this.  A simple javascript will do this for you.  here it is:



<SCRIPT LANGUAGE="JavaScript">
var theurl = document.location
if (theurl == "put your page address here where you will use the midi randomizer") {
   
song = new Array(10);

song[0] ='m/first song title name.mid'
song[1] ='m/second song title name.mid'
song[2] ='m/third song title name.mid'
song[3] ='m/fourth song title name.mid'
song[4] ='m/fifth song title name.mid'
song[5] ='m/sixth song title name.mid'
song[6] ='m/seventh song title name.mid'
song[7] ='m/eighth song title name.mid'
song[8] ='m/ninth song title name.mid'
song[9] ='m/tenth song title name.mid'
song[10] = 'm/eleventh song title.mid'


index = Math.floor(Math.random() * song.length);document.write("<DL>\n");
document.write("<EMBED SRC="+song[index]+" width=200 height=55 autostart=true loop=infinite BGCOLOR='enter background color'");
document.write("</DL>\n");
}
else{}
</SCRIPT>

to add more songs to the randomizer change the song = new array to the appropriate number and duplicate the song [number] thing.
This script goes between the head tags of your homepage.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to pick specific file from ftp 13 76
Need some help with powershell script 5 66
Scan Network and Export Reg value to single file 2 62
Scripting 4 35
If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question