Jump to content
xisto Community
cragllo

Script: Php Jukebox A one file script

Recommended Posts

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, I named it index.php and put it in a folder called 'music':

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://forums.xisto.com/no_longer_exists/ 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* Author Homepage:	 http://forums.xisto.com/no_longer_exists/* 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://forums.xisto.com/no_longer_exists/; 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><span style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#000000;">©2005 Craig lloyd. All rights reserved. <a href="http://forums.xisto.com/no_longer_exists/&%2334; target="_blank">Cragllo.com</a></span></body></html>
After you have created that file, upload it and make a folder in the same folder as the file is in called 'songs', and just upload a few mp3's to the 'songs' folder!

 

Thats it, your done, if you need any more help or have a question, simple reply here.

 

Thanks,

Craig.

Edited by cragllo (see edit history)

Share this post


Link to post
Share on other sites

hello cargllo,
it's nice script.. i found something similar before but which run with mx-system(phpbb powered portal system). i gotta one question,
if i host my song files on other host server(which is more about good to stream bandwidth), how this script can tweak to link that file..it's something like off-site avatar setting....
is it just simply change the path??

<embed src="songs/<?=$song;?>"
to
<embed src="off-site songs link/<?=$song;?>"

Share this post


Link to post
Share on other sites

Can you kindly suggest me a simple Jukebox to streem music on my website?

Script: Php Jukebox

 

Can you kindly suggest me a simple Jukebox to streem music on my website?

 

-reply by Sreenivas

Share this post


Link to post
Share on other sites

need help with WMA

Script: Php Jukebox

 

I like this script you did a great job on it, just one thing though is there some how I can edit it or you can to play WMA files along with mp3?

 

-question by Mitch

Share this post


Link to post
Share on other sites

Random Jukebox

Script: Php Jukebox

 

Hi

Need a script to play, say, 30 songs in a random order in my website jukeboxes.

 

I currently have a playall, but they play consecutively (notepad method)

 

Any advice please?

 

Thanks

Brian

 

-reply by Brian

Share this post


Link to post
Share on other sites

Random play jukebox

Script: Php Jukebox

 

Hi

At present my jukeboxes on my website have a playall facility which play cosecutively using a simple notepad method.

 

I need a script to randomise the play order...Any help/advice would be greatly appreciated.

 

TIA

Brian

 

-question by Brian

Share this post


Link to post
Share on other sites
Script does not display filesScript: Php Jukebox

Hello,

for some reason the script is not working for me.

I uploaded the script unaltered (did I have to change something into the name of my server?), and made a folder 'songs' in the same directory and put an .Mp3 file in it.

The jukebox panel displays normally, however, in the drop down menu, only "$file" appears under "Choose a song", no trace of my song in the folder.

When selecting the "$file" option I am left with a 404 error.

Any idea where I might have gone wrong?

Thanks,

Frankie.-reply by Frankie

Share this post


Link to post
Share on other sites

Hi,the script looks brilliant, however, I have an issue with it:I uploaded the script totally unaltered, and in the same direcory as the script I created a folder called 'songs' and put some .mp3 files in that folder.Now, when I go to the page, the image of the player is there, so is the drop down menu, but when clicking on the arrow of the drop down menu, underneath "Choose a song" there is only "$files.", which means that, when I click on "PLAY" I am greeted with a "Page not found" error.So, it seems like my songs in the folder are not seen/recognised by the script.Any idea where I might have gone wrong?Thank you.

Share this post


Link to post
Share on other sites

I have the same problem as last 2 above, all I see is pick a song and "$file"

I tried the code saved as index.Php

and

 I tried the code saved as index.Html

 

in the folder where I saved them I made a folder called songs

in that folder I added 10 mp3 files

I then loaded into my browser localhost/index.Php

I then loaded into my browser localhost/index.Html

both only show me the word "$file"in the drop drop down box.

Share this post


Link to post
Share on other sites
Hi Cragllo realy nice script created by tou but can you help me create a script just like in.com, musicindiaonline, songsbuz.rediff.com means many songs in different folder and when i am click on songs then they song a in playlist and play if i am click 2 songs means 1by1 so both songs add in current playlist.
I hope you getting my point. please reply I am waiting for you reply.

thanks


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, I named it index.php and put it in a folder called 'music':

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://forums.xisto.com/no_longer_exists/ 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* Author Homepage:	 http://forums.xisto.com/no_longer_exists/* 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://forums.xisto.com/no_longer_exists/; 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><span style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#000000;">Š2005 Craig lloyd. All rights reserved. <a href="http://forums.xisto.com/no_longer_exists/; target="_blank">Cragllo.com</a></span></body></html>
After you have created that file, upload it and make a folder in the same folder as the file is in called 'songs', and just upload a few mp3's to the 'songs' folder!

Thats it, your done, if you need any more help or have a question, simple reply here.

Thanks,
Craig.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.