FORUMS: list search recent posts

flash comm w/ PHP

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
bed718
flash comm w/ PHP
on Oct 31, 2007 at 2:05:32 am

Hi,

I am trying to set up a dynamic flash gallery that will read the files inside a folder then use that data to populate the gallery.
I'm almost done!

I would like the folder that the PHP code searches in to be loaded in from flash.

I have tried to use LoadVariables as in below:

[CODE]
var currentFolder:String = "folderPath"

_root.loadVariables( "pathtoPHPfile", "POST");
[/CODE]


the php code looks like this...

[PHP]

$folder = $_POST["folderPath"];

function show_dir($dir, $pos=2)
{
if($pos == 2)
{
echo "n";
echo "n";
}

$handle = @opendir($dir);
while ($file = @readdir ($handle))
{
if (eregi("^.{1,2}$",$file))
{
continue;
}

$string = $file;
$string_length = strlen($string);
$firstpart = strtok($string,"_");
$firstpart_length = strlen($firstpart);
$firstpart_length++;

$char_count = $string_length - $firstpart_length;

$final_part = substr($string,$firstpart_length,$char_count);
echo " n";
echo " " . $file. "n";
echo " " . $final_part. "n";
echo "
n";



}
@closedir($handle);

if($pos == 2)
{
echo "
n";
}

}

show_dir($folder);
[/PHP]


If I hard code in the folder for the "show_dir" funciton, everything works perfect... So, I dont think the problem is in show_dir. However, if I try to load in the folder variable nothing happens. Seems like the variable is not getting from flash to the php script

any ideas at all?
is there a better way to go about this??

any help would be great
-=b=-
[url]http://www.b-ed.com[/url]


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]