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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML

Status
Not open for further replies.

billwatson

Instructor
Dec 18, 2002
2,312
CA
Hi,
My knowledge of php is minimal

I have ben using this script to return the files in a folder to a flash file and what I need now is to have the php file either return the files as xml OR to create an xml file which i can then load into flash

php file

Code:
<?php

$maindir = $_POST["theDir"];
$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;
?>

can anyone help ?

or point me to a good tutorial

thanks
 
what do you want your xml schema to look like?
 
Thanks

Well the php file just returns a list of all files found in the directory so if it could be adapted to return this as xml something like <file>somePic.jpg</file> that would be great.

In some ways it be more useful if it actually created an xml file like that.

Hope this clears things up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top