Hey guys, I am having some trouble with this. I am trying to modify somones code(posted in the Flash forum) so that it reads the files in the directory and sends the filenames to flash as variables for display within my flash gui. I want to know if there is any way I can make them links rather than just text. Also, I am getting an error on the code:
<?php
$maindir = "" ;
$mydir = opendir($maindir);
while(false !== ($file = readdir($mydir))){
if(!is_dir($file)){
$fileList[] = $file;
}
}
closedir($mydir);
natsort($fileList);
$flash = "theFiles=";
foreach($fileList as $file){
$flash .= urlencode($file)."#";
}
echo $flash;
?>
It says:
[10-Jun-2003 11:31:36] PHP Warning: OpenDir: Invalid argument (errno 22) in myfile.php on line 3
[10-Jun-2003 11:31:36] PHP Warning: readdir(): supplied argument is not a valid Directory resource in myfile.php on line 4
Anybody have any ideas on either of those?
Thanks in advance,
Lumstar
______________________________________
And The Star Continues To Shine....
<?php
$maindir = "" ;
$mydir = opendir($maindir);
while(false !== ($file = readdir($mydir))){
if(!is_dir($file)){
$fileList[] = $file;
}
}
closedir($mydir);
natsort($fileList);
$flash = "theFiles=";
foreach($fileList as $file){
$flash .= urlencode($file)."#";
}
echo $flash;
?>
It says:
[10-Jun-2003 11:31:36] PHP Warning: OpenDir: Invalid argument (errno 22) in myfile.php on line 3
[10-Jun-2003 11:31:36] PHP Warning: readdir(): supplied argument is not a valid Directory resource in myfile.php on line 4
Anybody have any ideas on either of those?
Thanks in advance,
Lumstar
______________________________________
And The Star Continues To Shine....