You are here: Linking to mp3 files « PHP Programming Language « IT news, forums, messages
Linking to mp3 files

Posted by Bimperial on 02/05/07 06:21

Just another newb here in need of a little help....and probably some
sleep as well ;) I'm just getting started with PHP reading all I can
get my hands on, on and off line. I have simple bit of code that
displays a list of mp3 files from a different directory from which the
script runs in.....

<table align=CENTER bgcolor=#ffffff cellpadding=4 cellspacing=0
border=2>
<tr><th>Song Title</th></tr>
<?php
$dir = "../songs/";

// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "<tr><td> <a href=\"$dir\">$file</a> "."</td></tr>";
}
closedir($dh);
}
}
?>

the display is fine, I'm just pulling my hair out trying to get the
link to the individual files set correctly, but alas everything I've
tried so far bombs out. I do not know how to add the file name along
with the directory in the href ;(
Can somebody set me straight please......? Then I'll go to bed ;) TIA

Bewildered Bob

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация