User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 363,778 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,471 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Jul 15th, 2006
Views: 2,848
So im new to the PHP world because I have to learn it for work. So one of my clients is a musician and wanted a music player so I made a simple way the user could click a link and load a song.


ok first I set the variable that would change inside the player which I made "$song" and the variable is retreiving the song information from the url. Then in the urls you can see I set the attribute song equal to the mp3 file I want to load.
So now the page loads and when you click a link it gets the $song data from the url. The next step is to insert it into the player where the source was I put in the variable $song. And now your users can click the links and load what ever song they like. I know it is very basic but it gives the user more control over the quicktime player that you would normally need to use a flash player for.
Last edited : Jul 15th, 2006.
php Syntax
  1. <?php
  2. $song = $_GET['song'];
  3. echo '<a href="/jacobsite/music.php?song=Shpadoinkle.mp3">Shpadoinkle</a><br/>';
  4. echo '<a href="/jacobsite/music.php?song=Dani_California.mp3">Dani California</a><br/>';
  5.  
  6. echo '<embed qtsrc='.$song.' height"256" width="320" src='.$song.' type="image/x-quicktime" pluginspage="[http://www.apple.com/quicktime/download/]" autoplay="true">';
  7. ?>
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 10:33 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC