# UTILIZING FLASH+PHP -- Dynamically loaded JPG's

**URL:** <https://forum.kirupa.com/t/utilizing-flash-php-dynamically-loaded-jpgs/27698>\
**Category:** flash\
**Created:** [August 5, 2003, 7:10pm UTC](https://forum.kirupa.com/t/utilizing-flash-php-dynamically-loaded-jpgs/27698 "2003-08-05T19:10:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudeman](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dudeman](https://forum.kirupa.com/u/dudeman)\
**Post date:** [August 5, 2003, 7:10pm UTC](https://forum.kirupa.com/t/utilizing-flash-php-dynamically-loaded-jpgs/27698/1 "2003-08-05T19:10:33Z")

</div>

To keep it simple, the method will be the following:

1. Php script lists directory in a var named $dir
2. Flash grabs $dir var  
------Process can split right here------
3. Using AS, image filenames are loaded into a clickable scroll list

* * *

1. Using AS, all images are downloaded and sized to a thumbnail. If user wishes to view one he clicks on whichever and the image displays with 0-load time

So thats the shindig… I have the php script working out of Flash, but I’m not sure how to format it in one var because its echoing w/ \<br\> using the var… check it for yourself : [http://members.lycos.co.uk/dudeman26/dir.php](http://members.lycos.co.uk/dudeman26/dir.php)

The script was found on the web, I altered it:

```php
<?
//define the path as relative
$path = "./pics";
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");
echo "Directory Listing of $path<BR>";
//running the while loop
while ($dir = readdir($dir_handle)) {
        echo "$dir<br>";
}
//closing the directory
closedir($dir_handle);
?> 

```

p.s. The script still needs some editing… I’m sure I’ll get it fixed.
