Posted by Kimmo Laine on 02/05/07 07:15
"Bimperial" <bimperial@gmail.com> wrote in message
news:1170656518.954965.10050@k78g2000cwa.googlegroups.com...
> 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>";
how about:
echo "<tr><td> <a href='$dir/$file'>$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
Maybe you should try pottery or painting, you know... Something where you
work with your hands instead of your brain.
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)
[Back to original message]
|