php jukebox

Started on the old forum in February 2010 · view the original in the archive · old links redirect here

3 replies · 560 views · started 16 years ago · 1 min read

4 participants
convictor Developer · 114 posts #1

i found this on another site...

This scripts is so simple, you dont need to edit ANY of it! All you have to do is make a folder called 'songs' and put some audio files in it.

Here is the whole page, Graig, the coder, named it index.php and put it in a folder called 'music': CODE

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>PHP jukebox</title> </head> <body> <!-- ©2005 Craig lloyd. All rights reserved. Visit cragllo.com for more scripts --> <?php /** * ©2005 Craig lloyd. All rights reserved. * * Mod Title: Simple PHP Jukebox * Author: Craig Lloyd * Author Email: [cragllo@cragllo.com](mailto:cragllo@cragllo.com) * Author Homepage: [cragllo](http://www.cragllo.com/) * Description: A Simple Jukebox script to enable visitors to your site * to choose a song from a given list and play that song. * Release: v1.0, 17th May 2005 *** * Demo: None * Installation Level: Easy * Installation Time: 1 minute * Files To Edit: None * Included Files: index.php * Included Folders: songs/ * ----------------------[ HOW TO INSTALL ]---------------------------- * Simply upload this file and create a folder called 'songs' * Then just upload .mp3 files into the 'songs' folder * * Either show this page in an iframe or include it into any page * If you include it, the page it is included in has to be in teh same * folder as the songs folder!! */ //---------[ DO NOT EDIT UNLESS YOU KNOW WHAT YOU ARE DOING! ]---------

// Get information from form $song = $_POST['song']; $go = $_POST['go'];

if($go){ ?>

<!-- Player Start --> <object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab" width="240" height="43"> <param name="FileName" value="songs/<?=$song;?>"> <param name="AutoStart" value="true"> <param name="ShowTracker" value="true"> <param name="ShowControls" value="true"> <param name="ShowGotoBar" value="false"> <param name="ShowDisplay" value="false"> <param name="ShowStatusBar" value="false"> <param name="AutoSize" value="false"> <param name="PlayCount" value="0"> <embed src="songs/<?=$song;?>" AutoStart="true" ShowTracker="true" ShowControls="true" PlayCount="0" ShowGotoBar="false" ShowDisplay="false" ShowStatusBar="false" AutoSize="false" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" width="240" height="43"></embed> </object> <!-- Player End --> <?php } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <select name="song"> <option value="#">Choose a song</option> <!-- List Files Start --> <? $files = Array(); $path = "songs"; $dh = opendir($path); while ($file = readdir($dh)) { if (!is_dir($path."/".$file)) { if (is_file($path."/".$file)) { if (($file!=".") && ($file!="..")) { $files[] = $file; } } } } closedir($dh);

asort($files); foreach($files as $index=>$file) { echo "<option value="".$file."">".$file."</option>\n"; } ?>

<!-- List Songs End --> </select> <input name="go" type="submit" value="PLAY!"> </form> ©2005 Craig lloyd. All rights reserved. [Cragllo.com](http://www.cragllo.com/) </body> </html>

i didnt try it out yet, am going to try it out later this evening, and post a demo

Why cry for a soul set free?

neostar Developer · 109 posts #2

Does it works on mobile?

woody Developer · 176 posts #3

neostar wrote: Does it works on mobile?

works on some mobiles i tested it on n95 (working) and 6300 (not working)

thanks for the share

Sign in to reply.

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close