Popups from links

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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:

if ($dir = @opendir($realpath)) {
    while (($file = readdir($dir)) !== false) {
        if(is_file("$realpath/$file") && ($file!=".htaccess")){
    echo "<p>$n Files:</p>\n";
    echo "<ul>\n";
    for ($i=0;$i<count($list);$i++){
        echo "<li>";
        echo "<a href=\"$imagepath/$list[$i]\">$list[$i]</a>";
        echo "</li>\n";
    echo "</ul>";

Any help would be mucho appreciated!


Re: Popups from links

Bill Ray wrote:
Quoted text here. Click to load it

Small window, that implies javascript:
HTML: <a href="URL"   onClick="window.open('URL', 'window_name',
'window_options'); return false">

URL would be something like this:
<? $url = "show.php?file=".urlencode($filename); ?>
which expands to:

In show.php, there is something like this:
<? echo "<h2>".$_GET['file']."</h2>"; ?>
$_GET['file'] would hold Britney.mp3.

Site Timeline