473,508 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Popups from links

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

Mar 31 '06 #1
1 1055

Bill Ray wrote:
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.


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:
show.php?file=Britney.mp3

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

Mar 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2852
by: Art | last post by:
NEWBIE ALERT! Esteemed List Participants and Lurkers: (System: P-II 350, 192 meg, Win98 SE, Python 2.2.3, wxPythonWIN32-2.4.1.2-Py22.exe) I'm having a lot of fun getting started with Python...
52
4368
by: Harlan Messinger | last post by:
Can you help me figure out what to do about popups? Sometimes we develop web applications where popups make very good sense for precisely the same reasons they make sense in traditional...
2
1777
by: Tom Szabo | last post by:
Hi, >>IE in Windows XP Service Pack 2 has a popup blocker that blocks unsolicited >>popups >>IE (other than Windows XP Service Pack 2) also has many add-ons (Google toolbar, >>Yahoo! toolbar,...
3
2419
by: griffith | last post by:
I need some rather technical spidering advice, and I'm hoping that this is a good place to find it (and my apologies if this isn't). My site contains pages of images, where each image includes a...
1
1120
by: Nad42 | last post by:
I have been wondering if there is a possible way to stop popups on my own website. the thing is i have got a chat box which links to another site, but this seems to bring popups to my site, so...is...
4
2343
by: Christina | last post by:
A project I am working on requires 5 random popup windows that rotate. A cookie is set each time one of the popups occurs with a 5 day expire period. The visitor isn't supposed to see the same...
4
2175
by: robert.waters | last post by:
Hello, I have a main form that is maximized when my application loads; this main form contains links to all other forms. I've had to specify the Popup property of these other forms, so that...
3
4357
by: Raffi | last post by:
Hello, I've been struggling and trying to work around this for a while and have even posted on usenet in the past without any working solutions. I'm posting it again in case someone out there...
1
1625
by: YotamElal | last post by:
Hello, I have a popup problem. When a popup is opened, I want all other popups to close immediatly. (except for its self and it's child popups) Here is my code: code: <!DOCTYPE HTML PUBLIC...
1
2320
by: Moe Sisko | last post by:
Using : ASP.NET 2.0, IE 7. This is a strange problem with popups not working in IE to remote sites, even though popups are allowed in IE. To reproduce, create web site with two pages,...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7382
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7495
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.