Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/11/2014, 15:02
2344319
 
Fecha de Ingreso: noviembre-2014
Ubicación: gto
Mensajes: 1
Antigüedad: 9 años, 5 meses
Puntos: 0
Pregunta Reproducir lista de mp3 de php en red local

Hola tengo este codigo se muy poco de php
encontre este script en la red, lo peque en C:\AppServ\www
comparto una particion con mis equipos de red local s: donde estan todas los pistas de mp3 pero solo puedo ver la lista en la pagina y descargar en el servido y en las otras solo puedo ver la lista sin descargar me da error al darle al link guardar destino como dice: el sistema no encuentra la ruta. el codigo es este:

Music Library

<html><head>

<title>La mejor musica</title>

<style type="text/css">
a {text-decoration: none; color: navy;}
a:hover {text-decoration: underline; color: green;}
body, a {font-family: 'Trebuchet MS'; font-size: 10pt;}
</style>

</head>

<body>

<center>

<h1>Music</h1>
<br>
</center>

<table border="0" width="100%">
<tr><td width="75%" valign="top">
<center>
<b><span style="color: black; size: 12;">musica</span></b><br><br>
</center>
<?php
$default_dir = "s:\\";

if (!(isset($searchFor)) && !(isset($sort_order))) {$display = "all";}
$allEnds = "sort_order=$sort_order&include=$include&searchFor =$searchFor&search=$search&display=$display&dir=$d ir";
if (empty($dir)) {$dir = $default_dir;}

$dp = opendir($dir);

if (empty($searchFor)) {$display = "all";}

if (ereg("\\\\",$dir))
{
$dir2 = str_replace("\\\\","\\",$dir);
if (isset($dir2))
{
$dir = $dir2;
}
}

while($file = readdir($dp)) $filenames[] = $file;

if (($sort_order == "alphabetical") || !(isset($sort_order)))
{ sort($filenames);
$sort_order = "alphabetical"; }
else if ($sort_order == "shuffle")
{ shuffle($filenames); }
else if ($sort_order == "reverse_alphabetical")
{ rsort($filenames); }
for($i = 0; $i < count($filenames); $i++)
{
$file = $filenames[$i];
if (
(($include == "0") && ((eregi("incomplete", $file)))) ||
($file == ".") ||
!(($display == "all") || (($search == "1") && ($searchFor != "") && (eregi("$searchFor", $file))))
)
{}
else
{
if ((eregi(".+\.[A-Z0-9]{3,4}",$file)) || (eregi(".+\.com",$file)))
{
if (ereg(".mp3",$file)) {$parts = explode(".mp3", $file);} else if (ereg(".MP3", $file)) {$parts = explode(".MP3", $file);} else if (ereg(".mP3", $file)) {$parts = explode(".mP3", $file);} else {$parts = explode(".Mp3", $file);}
echo "<a href=\"$dir\\$file\"";
if (!(eregi(".mp3",$file))) {echo " target=\"_blank\"";}
echo ">$parts[0]</a><br>\n";
}
else
{
if ($file == "..")
{
echo "<a href=\"$PHP_SELF?dir=$dir\\..\"><b><i>Above Directory</i></b></a><br>\n";
}
else
{
echo "<a href=\"$PHP_SELF?dir=$dir\\$file\"><b>$file</b></a><br>\n";
}
}
}
}

?>
</td>

<td width="25%" valign="top">
<center>
<b><span style="color: black; size: 12;">sort order</span></b><br><br>

<a href="<?php echo "$PHP_SELF?$allEnds&sort_order=alphabetical";? >">A-Z</a><br><br>
<a href="<?php echo "$PHP_SELF?$allEnds&sort_order=reverse_alphabetica l";?>">Z-A</a><br><br>
<a href="<?php echo "$PHP_SELF?$allEnds&sort_order=shuffle";?>">Al azar</a><br><br>

<?php
if ($include == "1")
{ $newinclude = "0"; }
else
{ $newinclude = "1"; }


echo "<br><br><form>";
echo "<a href=\"";
echo "$PHP_SELF?$allEnds&include=$newinclude";
echo "\"><input type=\"checkbox\"";
if ($newinclude == "0")
{echo " checked";}

echo "> Incluir archivos incompletos (estos archivos no se puedan reproducir))</a>
</form>";

?>

<br><br>

<form action="<?php echo $PHP_SELF; ?>" method="get">
<input type="text" name="searchFor" value="<?php if (isset($searchFor)) {echo $searchFor;}?>">
<input type="hidden" name="include" value="<?php echo $include; ?>">
<input type="hidden" name="sort_order" value="<?php echo $sort_order; ?>">
<input type="hidden" name="dir" value="<?php echo $dir; ?>">
<input type="hidden" name="search" value="1">
<input type="submit" value="search" style="border-width: 1; border-color: black; font-color: black; background: white; font-family: 'trebuchet ms';">
</form>

<a href="<?php echo "$PHP_SELF?sort_order=$sort_order&include=$include &display=all&dir=$dir";?>">display all</a>

<br><br>

<a href="<?php echo "$PHP_SELF?sort_order=alphabetical&include=0"; ?>">Default Directory</a>
</center>


</body>
</html>

Si me pueden ayudar a reproducir y poder descargas estos link al darle clic se los agradeceria mucho...