Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP and Flash

Status
Not open for further replies.

lumstar

Technical User
Joined
Jan 29, 2002
Messages
177
Location
CA
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 = &quot;&quot; ;
$mydir = opendir($maindir);
while(false !== ($file = readdir($mydir))){
if(!is_dir($file)){
$fileList[] = $file;
}
}
closedir($mydir);
natsort($fileList);
$flash = &quot;theFiles=&quot;;
foreach($fileList as $file){
$flash .= urlencode($file).&quot;#&quot;;
}
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....
 
shouldn't

$maindir = &quot;./&quot;


for current directory? // that is the directory you wanna look at right?
And did you chmod your directories?
 
sorry

Code:
// current directory
$maindir = &quot;./&quot;;

// any other directory within current
$maindir = &quot;./directory&quot;;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top