Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys, i need some help in developing my project. I am developing a web-based application system. The system include a function which allow the system to play song from a folder based on user input in a textfield. Is there any way to do it in PHP? Btw, i am using Firefox for the webbrowser. Please help :(( :((
Posted

Using PHP for this is somewhat strange because this runs on the server. You could however use javascript to do this dynamically. Have a look at the link below. Hopefully this will help.

http://www.phon.ucl.ac.uk/home/mark/audio/play.htm[^]


Good luck!
 
Share this answer
 
Hmm, but what i am trying to find is playing a local audio file according to user input. Is there any possibility i could do it in php like using the fopen or fread method? javascript and ajax could be fine too i guess. If anyone of you gurus have any guidance or site i could refer to it would be great :)
 
Share this answer
 
Write following code in html or .net.
just change the filename ,ok




1). For Video

<object height="350" width="400" align="middle" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="Window_Media_Player_Video">"
<param name="FileName" value="Window_Media_Player_Video" />
<param name="AutoRewind" value="true" />
<param name="AutoStart" value="false" />
<param name="Clicktoplay" value="true" />
<param name="Mute" value="false" />
<param name="ShowTracker" value="true" />
<param name="ShowControls" value="true" />
<param name="PlayCount" value="1" />
<param name="Src" value="1.dat" />







2). For Audio

<object height="150" width="400" align="middle" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="Window_Media_Player_Video">"
<param name="FileName" value="Window_Media_Player_Video" />
<param name="AutoRewind" value="true" />
<param name="AutoStart" value="false" />
<param name="Clicktoplay" value="true" />
<param name="Mute" value="false" />
<param name="ShowTracker" value="true" />
<param name="ShowControls" value="true" />
<param name="PlayCount" value="1" />
<param name="Src" value="3603_Papa Kehte Hain.mp3" />
 
Share this answer
 
thanks for your guys help but i still could not play local music file from a folder according to user input. I could not find any example or any codings that were similar to that function.

If you guys still have any references, scripts, etc, please help. :sigh:
 
Share this answer
 
okay, another way, lets say i created a table in database called mp3db containing the files path to a folder called mp3folder, containing all mp3 files.

Then in php, when user enter a song name (song.mp3) in a text field, the url would be retrieved and displayed.

How could this be done? Please help gurus :confused:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900