Re: Populate picklist from directory and return file name
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Populate picklist from directory and return file name

From: sunbum <mbrashars@gmail.com>
Date: Wed Sep 14 2005 - 18:29:12 CEST

Thanks Sandman,

Could you glance at this and see if I'm going in the right direction?

<?php
<html>
    <head><title>Cooler Log Graph</title></head>
    <body>

<form action="coolerlinec.php" method="post">;
    # Directory
    $dir = "/inetpub/wwwroot/templogs/";

    print "<select name='file'>";
    $dir = opendir($dir);
    while (false !== ($file = readdir($dir))){
        if (in_array($file, array(".", ".."))) continue;
        print "<option value='$file'>$file</option>";
    }
    print "</select>";

<input type="submit" value="Submit">;
</form>

    </body>
</html>
?>

Thanks again!

Anyone else is more than welcome to chime in too! The main function is
from "Sandman" and works great, I am now just trying to incorporate it
into a form. Obviously I am greener than grass ;)

Mike
Received on Tue Oct 18 02:23:33 2005