Current location: Hot Scripts Forums » Programming Languages » PHP » Playing Music in website using PHP


Playing Music in website using PHP

Reply
  #1 (permalink)  
Old 01-31-07, 12:43 AM
raji20 raji20 is offline
Newbie Coder
 
Join Date: Aug 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Playing Music in website using PHP

How to play a music throughout the website using PHP code .ie I want to play music in all pages of my website but I dont want the song to start from the beginning every time when a link is clicked.
The song list will be coming from the database, where admin can able to upload the music file.
Can anyone help me.Please
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-31-07, 04:54 AM
Vicious's Avatar
Vicious Vicious is offline
Community VIP
 
Join Date: Jan 2007
Location: Belgium
Posts: 584
Thanks: 0
Thanked 0 Times in 0 Posts
I don't think it's possible with PHP (or any other server side language).
Maybe only in flash, if you make your entire site in flash.
__________________
Jack Bauer makes Chuck Norris cry
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 01-31-07, 07:26 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
the only thing i can think about is using frames: you place the embedded sound in one frame, and you reload the other frame when opening a different page.

UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 01-31-07, 09:09 PM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
Multiple pages on one page

What you want to do in PHP is possible, providing you are desiging all your own pages. What I mean is not trying to display someone elses website on yours.
First you load all your pages using require("somepage.php"), into separate <div>'s, with their visibility inside their style set to "hidden", their positioning set to relative, their width and height all set the same and they are all listed together.
Next you create a few javascript functions to handle flow control. What I mean by this is the javascript will turn the visibility attribute of each <div> on or off depending on what function your <a> tags are attached to.
Now you <embed> your sound(or what ever other method you use) in to your main page. The javascript controls flow and the music plays on.
__________________
Jerry Broughton
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 02-01-07, 12:37 AM
Grabber's Avatar
Grabber Grabber is offline
Newbie Coder
 
Join Date: Apr 2006
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
SAY NO TO FRAMES...

you can do it with simple HTML EMBED tags,

<embed src="/path/toyour/soundfile.mp3"> </embed>

the extension can be anything like avi, mp3 etc etc...

i have used the simplest form of embed tags though it will work for sure, however i would suggest you to google to see its perfect use...

you can also load the sound file into a small flash movie and then load it on your pages, you dont need to make full site in flash for this just a small 1x1 movie that only loads the sound file...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 02-01-07, 01:18 AM
grafman grafman is offline
Coding Addict
 
Join Date: Dec 2006
Posts: 278
Thanks: 0
Thanked 0 Times in 0 Posts
Grabber,

If you want the music to play without interruption and not cycle you need to use a frame. Normally a 1px by 1px.
__________________
"Things are difficult only while you don't understand them."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 02-01-07, 01:24 AM
n3wb!e's Avatar
n3wb!e n3wb!e is offline
Wannabe Coder
 
Join Date: Mar 2006
Posts: 216
Thanks: 2
Thanked 0 Times in 0 Posts
i think the best possible way is to use <frames> with <embed> !

http://www.webreference.com/js/column20/embed.html
__________________
i am still a learner and i like $this-> smilie!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Website protection in PHP danrhodes1987 PHP 12 04-19-05 06:25 PM
developing e-learning website using php tbd911 PHP 1 04-11-05 11:37 PM
PHP scripts related website - Banner Exchange? shadi Traffic Exchange 4 01-02-05 03:02 PM
PHP Website nicpon PHP 3 12-10-04 09:58 AM
Website Managment with PHP ? lunatick PHP 8 12-04-04 10:50 AM


All times are GMT -5. The time now is 07:18 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.