You are here: Re: Populate picklist from directory and return file name « PHP Programming Language « IT news, forums, messages
Re: Populate picklist from directory and return file name

Posted by Sandman on 11/04/66 11:27

In article <rInVe.14457$ct5.12705@fed1read04>,
"Mike Brashars" <mike@apayrollservice.com> wrote:

> Hi all,
>
> I have been searching for a week and am unable to find and example to
> "Populate picklist from directory and return file name".
>
> I have a php script that reads a log file and plots a graph. Right now, the
> log name is hard coded. The logs are archived each day in the form of say
> ddmmyy.log and I would like to put a drop down list in the script that would
> allow my script to run off the "log" picked or default to the current "hard
> coded" name.
>
> I thought this would be a really common thing but I guess not.
>
> I would be open to a javascript or asp script as long as I could "feed"
>
> the file name to my php script.
>
> Can anyone point me to a script like this??
>
> Thanks a million!

<?
# Directory
$dir = "/path/to/a/dir/";

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

?>



--
Sandman[.net]

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация