Play MP3 on Page Load: Easily Learn How

  • Thread starter Thread starter Mk
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 4K views
Mk
Messages
2,040
Reaction score
4
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?
 
Physics news on Phys.org
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.