PHP Directory include (MP3)

Discussion in 'PHP' started by webber09, Jan 14, 2011.

  1. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #21
    right okay, not a problem!
     
    webber09, Jan 22, 2011 IP
  2. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #22
    right okay all sorted :D have gone with

    <OBJECT id='mediaPlayer1' width="300" height="63"
    classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'
    codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
    standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
    <param name='fileName' value="./mp3s/<?php echo $_GET['file']; ?>">
    <param name='transparentatStart' value='true'>
    <param name='autoStart' value="false">
    <param name='showControls' value="true">
    <param name ="ShowAudioControls"value="true">
    <param name="ShowStatusBar" value="true">
    <param name='loop' value="false">
    <EMBED type='application/x-mplayer2'
    pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
    id='mediaPlayer' name='mediaPlayer' displaysize='1' autosize='1'
    bgcolor='darkblue' showcontrols="true" showtracker='-1'
    showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="300" height="63"
    src="./mp3s/<?php echo $_GET['file']; ?>" autostart="true" designtimesp='5311' loop="false">
    </EMBED>
    </OBJECT>

    and will leave out any symbols from the name!!
     
    webber09, Jan 22, 2011 IP
  3. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #23
    it's not about browser, but about server proccessing.

    As you know, & is exploding different $_GETs and server things you want to explode file= nelly &somemoregets= something
    Trust me, it has nothing to do with browsers
     
    G3n3s!s, Jan 22, 2011 IP
  4. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #24
    well its okay now anyway :D thank you very much again!! :D
     
    webber09, Jan 22, 2011 IP
  5. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #25
    I am already listening xD
    I was trying to do internet radio (script) many times but everytime failed... :(

    can you give me full source code of player.php?
     
    G3n3s!s, Jan 22, 2011 IP
  6. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #26
    do a view source on it, or the player itself is above :D
     
    webber09, Jan 22, 2011 IP
  7. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #27
    you have same style on all pages. You're copying them ?
     
    G3n3s!s, Jan 22, 2011 IP
  8. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #28
    the way i design it all the div's have the same style, this is how it should be in any design, the only time i have changed the style is when i may not want the sidebar, or another curtain feature
     
    webber09, Jan 22, 2011 IP
  9. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #29
    also did you find a way of removing the .mp3 part from displaying?
     
    webber09, Jan 22, 2011 IP
  10. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #30
    oh you want to remove .mp3 from end? You think in adress?

    if so so that list should be like this
    $f = opendir("mp3");
    
    while($mp3 =  readdir($f))
    {
     if ($mp3 != "." && $mp3 != "..")
     {
      $mp3 = preg_replace("/\.mp3/", "", $mp3);
      echo "<a href='player.php?file=".$mp3."'>$mp3</a><br />";
     }
    }
    PHP:
    and player.php should be like this
    <OBJECT id='mediaPlayer1' width="180" height="50"
    classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'
    codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
    standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
    <param name='fileName' value="mp3/<?php echo $_GET['file']; ?>.mp3">
    <param name='animationatStart' value='true'>
    <param name='transparentatStart' value='true'>
    <param name='autoStart' value="false">
    <param name='showControls' value="true">
    <param name ="ShowAudioControls"value="true">
    <param name="ShowStatusBar" value="true">
    <param name='loop' value="false">
    <EMBED type='application/x-mplayer2'
    pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
    id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'
    bgcolor='darkblue' showcontrols="true" showtracker='-1'
    showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="420" height="380"
    src="mp3/<?php echo $_GET['file']; ?>.mp3" autostart="true" designtimesp='5311' loop="false">
    </EMBED>
    </OBJECT>
    PHP:
     
    Last edited: Jan 22, 2011
    G3n3s!s, Jan 22, 2011 IP
  11. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #31
    if i put the above code in it shows nothing! :S
     
    webber09, Jan 22, 2011 IP
  12. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #32
    it works xpresscenter.co.uk/radio/od/player.php?file=The%20Black%20Eyed%20Peas%20-%20The%20Time%20%28Dirty%20Bit%29
     
    G3n3s!s, Jan 22, 2011 IP
  13. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #33
    oh sorry, I got it!
    $f = opendir("mp3");
    
    while($mp3 =  readdir($f))
    {
     if ($mp3 != "." && $mp3 != "..")
     {
      $mp3 = preg_replace("/\.mp3/", "", $mp3);
      echo "<a href='player.php?file=".$mp3."'>$mp3</a>";
     }
    }
    PHP:
    this one !

    EDIT: I see see it works :)
     
    G3n3s!s, Jan 22, 2011 IP
  14. webber09

    webber09 Active Member

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #34
    thanks :D :D
     
    webber09, Jan 22, 2011 IP