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: Sandman <mr@sandman.net>
Date: Tue Sep 13 2005 - 18:45:24 CEST

In article <1126621984.221410.309530@g44g2000cwa.googlegroups.com>,
 "sunbum" <mbrashars@gmail.com> wrote:

> Here is what I have now ... (without the line numbers)
>
> 1)<?
> 2) # Directory
> 3) $dir = "\inetpub\wwwroot\templogs\";
> 4)
> 5) print "<select name='file'>";
> 6) $dir = opendir($dir);
> 7) while (false !== ($file = readdir($dir))){
> 8) if (in_array($file, array(".", ".."))) continue;
> 9) print "<option value='$file'>$file</option>";
> 10) }
> 11) print "</select>";
> 12)
> 13)
> 14)?>
>
> Still gives "Parse error: parse error, unexpected T_STRING in (script)
> on line 5

Strange. It works like a charm for me. Maybe you got some strange invisible
character caught on that line?

-- 
Sandman[.net]
Received on Mon Oct 24 02:10:00 2005