Quantcast Play mp3 on pageload Text - Physics Forums Library

PDA

View Full Version : Play mp3 on pageload


Mk
Aug13-08, 06:27 PM
I have a website idea that I want to do to learn a little bit more about making web sites. One thing I don't know how to do, is I want the website to be able to randomly pick a sound file out of a directory, and play it on pageload. There will be a changing amount of sound files, so it wouldn't be good if I'd have to change a parameter of how many files there are every time. I don't know if I should be using php, or javascript, or something else. Can anybody help me?

Ben Niehoff
Aug22-08, 03:29 AM
The easiest way I can think of would be PHP. You might be able to do AJAX (JavaScript), though. But PHP would be best.

And for the love of all that is holy, please don't put auto-playing sounds on an actual production website.