Jump to content

Archived

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

madspof

GET comand mixed into a listing script

Recommended Posts

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>

Share this post


Link to post
Share on other sites
Try:
$fp = opendir($dir . '/' .$directory);

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

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.