Jump to content


Photo

GET comand mixed into a listing script


  • Please log in to reply
2 replies to this topic

#1 madspof

madspof
  • Members
  • PipPipPip
  • Advanced Member
  • 271 posts

Posted 03 September 2006 - 06:04 PM

i need some help with a script that i have edited i no that the script worked when i haddnt edited but i now need for the script to get the directory name for it to list. I think the part of the script  that is wrong is this bit:$fp = opendir($dir/$directory); but this is the whole script can some one have a look and see if anythink is obv wrong with it
<?php

// The folder where you keep your mp3's
$directory = $_GET["directory"]; // ?directory=song_name.mp3
$dir = "music"; 
$fp = opendir($dir/$directory);

while ($file = readdir($fp)) {

    if (!ereg("^\.", $file)) {
   
        $file_url = "$dir/$directory/" . $file;
?>


<body bgproperties="fixed" background="back%20(Custom).jpg">
<div align="center"><a href="<?php echo("playertest.php?song=$file"); ?>" target="banner2"><?php echo($file); ?></a><br>
 
  <?php
    }
}
closedir($fp);

?>
</div>

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 September 2006 - 06:10 PM

Try:
$fp = opendir($dir . '/' .$directory);

instead of $fp = opendir($dir/$directory);

#3 madspof

madspof
  • Members
  • PipPipPip
  • Advanced Member
  • 271 posts

Posted 03 September 2006 - 06:13 PM

thnks that worked




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users