Re: Is PHP the language for me???

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

 



On 9/23/05, Emily McCall <emily.mccall@xxxxxxxxxxxx> wrote:> I am trying to figure out whether php will help me to set up a website> which is essentially just links to donwloadable material.>> I have directories in place and am using flash to auto fill the directory> names on to an index page, however i cant use this to access the files> themselves. So I am after a language i can use to read all the file names> in the directory and display them with a bit of 'niceness' onto a webpage> so as they can be used as links to the files.

Yeah, PHP can do that.  Toss this in a web directory and pull it up ina browser.
<?php
$files = array();
$d = dir( './' );
while( false !== ( $entry = $d->read() ) ){    if( $entry != '.'        && $entry != '..'        && !is_dir( $entry ) )    {        $files[] = $entry;    }}
sort( $files );
foreach( $files as $file ){
echo <<<EOF<a href="$file">$file</a><br />EOF;
}
?>

--Greg DonaldZend Certified EngineerMySQL Core Certificationhttp://destiney.com/

[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