Re: Is PHP the language for me???

From: Date: Fri, 23 Sep 2005 22:14:55 +0000
Subject: Re: Is PHP the language for me???
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-223103@lists.php.net to get a copy of this message
On 9/23/05, Emily McCall <emily.mccall@ntlworld.com> 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 in a 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 Donald Zend Certified Engineer MySQL Core Certification http://destiney.com/

« previous php.general (#223103) next »