Re: [PHP] Show filenames using Wildcards -- The glob() Solution!
- From: sleepwalker@xxxxxxxxxxxxxxxx (Rahul Sitaram Johari)
- Date: Fri, 30 Mar 2007 10:25:14 -0400
Ave,
This Works!!!
<?php
foreach (glob("vox/".$row['PHONE']."*.vox") as $value) {
echo "<OPTION
VALUE='takekey_download.php?F=vox/".basename($value)."'>".basename($value)."
</option>";
}
?>
Dug up glob() in the manual, followed examples and details works like a
charm!
Full code:
<SCRIPT LANGUAGE="JavaScript">
function openVox(form) {
var newIndex = form.voxSelect.selectedIndex;
if (newIndex == 0) {
//alert( "Please select a file to download!" );
} else {
dlvox = form.voxSelect.options[newIndex].value;
window.location.assign(dlvox);
}
}
</SCRIPT>
<FORM NAME="voxForm" STYLE="margin: 0px; padding: 0px;">
<SELECT NAME="voxSelect" onChange="openVox(this.form)">
<OPTION>... Choose Recording ...</OPTION>
<?php
foreach (glob("vox/".$row['PHONE']."*.vox") as $value) {
echo "<OPTION
VALUE='takekey_download.php?F=vox/".basename($value)."'>".basename($value)."
</option>";
}
?>
</SELECT>
</FORM>
Thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.
W: http://www.rahulsjohari.com
E: sleepwalker@xxxxxxxxxxxxxxxx
³I morti non sono piu soli ... The dead are no longer lonely²
- Follow-Ups:
- Re: [PHP] Show filenames using Wildcards -- The glob() Solution!
- From: "Tijnema !"
- Re: [PHP] Show filenames using Wildcards -- The glob() Solution!
- From: Jochem Maas
- Re: [PHP] Show filenames using Wildcards -- The glob() Solution!
- Prev by Date: Re: [PHP] simple page not found 404 script - PHP
- Next by Date: Re: [PHP] Gnome and MIME types
- Previous by thread: tabbed navegation PHP
- Next by thread: Re: [PHP] Show filenames using Wildcards -- The glob() Solution!
- Index(es):
Relevant Pages
|