Re: Show filenames using Wildcards -- The glob() Solution!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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²

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux