# Directory list by PHP in Flash

**URL:** <https://forum.kirupa.com/t/directory-list-by-php-in-flash/159477>\
**Category:** Uncategorized\
**Created:** [August 17, 2005, 8:26pm UTC](https://forum.kirupa.com/t/directory-list-by-php-in-flash/159477 "2005-08-17T20:26:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Septunas](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@Septunas](https://forum.kirupa.com/u/Septunas)\
**Post date:** [August 17, 2005, 8:26pm UTC](https://forum.kirupa.com/t/directory-list-by-php-in-flash/159477/1 "2005-08-17T20:26:30Z")

</div>

Hello,  
I need a folder list to be displayed in Flash.  
Therefor I used a tut that explains how to do it.  
I get the number of files,but I don’t get the filenames.  
In PHP, they are displayed, but does anybody know how to display them in Flash.  
I think it’s with a loop, but I don’t know how.

This is the PHP code :

```auto

<?php
$path = "thumb" . $_REQUEST['path'];
$output_string = '';
$file_number = 0;
$dir = dir( $path ); 
while ( false !== ( $file_name = $dir->read() ) ) { 
	if( $file_name[0] != '.' ){
		$output_string .= "&file_" . ++$file_number . "=" . urlencode( $file_name );
	}
} 
$dir->close(); 
print "&file_count=$file_number&$output_string";
?>

```

and this is the AS :

```auto

dir = new LoadVars();
response = new LoadVars();
response.onLoad = getResponse;
dir.sendAndLoad("dircontent.php", response, "POST");
function getResponse( result ) {
  file_count = response.file_count;// gives number of files
}

```

I found many posts about it, but no answers…
