Jump to content

[SOLVED] Play music using php


Nandini

Recommended Posts

Hi friends

I dont know this is the correct place to post this type of question. But i want to solution.

I am doing my personal website. I that i am providing send greetings, online tutorials and entertainment and etc. Till now tutorials and send greetings are completed. But for entertainment i want to play songs. For playing songs i am using following script. Its working properly working in I.E. But in mozilla and netscape its not working. means browser asking install missing plugins. When i click that button it displays as "no plugins available". Without install plugins i can't play music file in my browser using php. So can any one tell me howc can i install plugins. Send me plugins url's if any.

 

my script:

 

<embed src="myfile.mp3" autostart="true" loop="true" width="2" height="0">

</embed>

<noembed>

<bgsound src="myfile.mp3" loop="infinite">

</noembed>

 

Thanx in advance

Link to comment
Share on other sites

<?php
echo " <embed src=\"myfile.mp3\" autostart=\"true\" loop=\"true\" width=\"2\" height=\"0\"> ";
echo " </embed> ";
echo " <noembed> ";
echo " <bgsound src=\"myfile.mp3\" loop=\"infinite\"> ";
echo " </noembed> ";
?>

 

wat

 

 

Yep.

 

PHP can't play music. It is a serverside scripting lang. With some obscure plugin, it may be able to output sound on CLI applications, but otherwise, no.

 

Chris

Link to comment
Share on other sites

Flash.

But why would you want to. I mean, it's terrible. It's up there with bad things like marquees. I hate the background music on websites. If you need the music on there then maybe offer it as a download.

 

Only other thing I can suggest is feeding it into a dynamic flash mp3 player, which you should be able to get free if you google it.

Link to comment
Share on other sites

Hi ProjectFear thanx for ur reply

 

This is not for background music of website.

the design is, i have to put some songs links to listen for users.

if user click on it, the popup box will open and playing that song. Its just like jukebox(radio). This is what i want.

Is there any possibility to do this using php.

 

Thanq

Link to comment
Share on other sites

If you just provide the link for the song (e.g. <a href="mysong.mp3">my song</a>) when the person clicks on it they will be presented with a download box (as you would expect for more exes/apps) where they can choose to "open" or "save" the file. Assuming that the person in question has mp3 software, usually their player will play the music if they choose "open". This, however, is NOT facilitated by PHP, and i suspect is not what you want either...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.