Jump to content


This topic is now archived and is closed to further replies.


A little out there.

Recommended Posts

This question is a little different than you’re usual.  I want to create an online media player for radio shows.  I want to be able to click on the show link and have the player change the file that it’s requesting to that episode.  The links end up being player2.php?id=rhr6.mp3 just like I want, but I want the name of the file to change to rhr6 in the QuickTime audio player.  I hope that makes some scene.  It should be to hard. Any thoughts, or If you dont get it can I clarify.  Heres the code that creates the links based on the files in the folder, and then at the bottom the audio part that I want to change.


A seperate window for .mp3 file playing, built for online radio shows.
    echo "<table style='padding-left: 0px; width: 100%;' border='0' cellspacing='0' cellpadding='0'>";
//The path for the show list
    $dirpath = "feignews/shows/rhr";
    $dh = opendir($dirpath);
      while (false !== ($file = readdir($dh))) {
//Makes sure to not show subdirectories
          if (!is_dir("$dirpath/$file")) {
//Creates link and file name
          echo "<tr><td class='col-4' scope='col' width='100%'><span class='nav4'><a href='player2.php?id=". ($file) ."'>". htmlspecialchars(ucfirst(preg_replace('/\..*$/', '', $file))) . "</a></span></td></tr>";
echo "</table>";
//Close Select

<div id="scrollArea">
  <div id="scroller"></div>
                        <td style="padding-left:10px;" valign="top" bgcolor="#F2F2F2" scope="col"><img src="/feignews/img/amigabanner.jpg" alt="Amiga" class="elegantborder"><br /><br /><br />
<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
<PARAM name="SRC" VALUE="<?php
switch($id) { default: echo('ag.mp3');
break; case "$whatdoidohere": echo('$togetitright');
} ?> ">
<PARAM name="AUTOPLAY" VALUE="false">
<EMBED SRC="ag.mp3" WIDTH="262" HEIGHT="15" AUTOPLAY="false"></EMBED>

Share this post

Link to post
Share on other sites
When you load the player just set the src to file name using $_GET

I'm not sure of the syntax of loading quicktime, you may already have it or you can find it on the web I'm sure but it would go something like this

provided that id is what holds the file name

<EMBED SRC="<? echo $_GET['id'] ?>" WIDTH="262" HEIGHT="15" AUTOPLAY="false"></EMBED>

Share this post

Link to post
Share on other sites


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.