Php Read the directory on the local server

<?php
header(“Content-type: text/xml”);$handle=opendir(“e:\media”); // open the current directory by opendir

$xml_output = “<Files>\n”;

while (($file = readdir($handle))!==false) {
//echo “$file <br>”;
$xml_output .= “\t<entry>\n”;
$xml_output .= “\t\t<Title>” . $file . “</Title>\n”;
$xml_output .= “\t\t<FileName>” . $file . “</FileName>\n”;
$xml_output .= “\t</entry>\n”;
}

$xml_output .= “</Files>”;

echo $xml_output;

closedir($handle);
?>

Tags: , ,

Leave a Reply

You must be logged in to post a comment.

My Latest Video
Weather forecast in San Bernardino
My Photos on Pond 5
Royalty-Free Stock Video at Pond5
Posts
Speedtest 2014 B
Speedtest.net Mini requires at least version 8 of Flash. Please update your client.
Speed Test
Recent Posts
    Sponsers
    Your IP Info
    Login