You are here: Popups from links « PHP Programming Language « IT news, forums, messages
Popups from links

Posted by Bill Ray on 03/31/06 06:46

Heya all

I have a script that allows my website to display the contents of a
folder as links. I want those links to open as their MIME type (MP3
files) in a small window, displaying that file's name as an H2 tag.

Can someone help me out? Here's the script that I have:


$imagepath="/media/mp3s/new_tunes";
$realpath=$_SERVER['DOCUMENT_ROOT']."$imagepath";
$n=0;
$list=array();
if ($dir = @opendir($realpath)) {
while (($file = readdir($dir)) !== false) {
if(is_file("$realpath/$file") && ($file!=".htaccess")){
$n++;
$list[]=$file;
}
}
closedir($dir);
natcasesort($list);
echo "<p>$n Files:</p>\n";
echo "<ul>\n";
for ($i=0;$i<count($list);$i++){
$x=$i+1;
echo "<li>";
echo "<a href=\"$imagepath/$list[$i]\">$list[$i]</a>";
echo "</li>\n";
}
echo "</ul>";
}

Any help would be mucho appreciated!

~B

 

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

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