Fatal error: Call to undefined function getfilelist()
<p>why i get this error:</p>

<blockquote>
  <p>Fatal error: Call to undefined function getfilelist() in
  /home/se7encla/public_html/dir.php on line 3</p>
</blockquote>

<p>and how to resolve that?!</p>

<p>line 3 is  </p>

<pre><code> $dirlist = getFileList("./Update/");
</code></pre>

<p>dir.php</p>

<pre><code> &lt;?PHP
 // examples for scanning a directory called images
 $dirlist = getFileList("./Update/");
?&gt;
</code></pre>

<p>echo.php</p>

<pre><code>&lt;?PHP
 // output file list as HTML table
  foreach($dirlist as $file) {
echo "&lt;tr&gt;\n";
echo "&lt;td&gt;{$file['name']}&lt;/td&gt;\n";
echo "&lt;td&gt;{$file['Stream']}&lt;/td&gt;\n";
echo "&lt;td&gt;{$file['size']}&lt;/td&gt;\n";
 }
echo "\n";
?&gt;
</code></pre>

<p>update.php</p>

<pre><code> &lt;?PHP
  if(isset($_GET['action']) and ($_GET['action']=="list"))
{
require_once "./dir.php";
require_once "./echo.php";

 function getFileList($dir)
  {
// array to hold return value
$retval = array();

// add trailing slash if missing
if(substr($dir, -1) != "/") $dir .= "/";

// open pointer to directory and read list of files
$d = @dir($dir) or die("getFileList: Failed opening directory $dir for reading");
while(false !== ($entry = $d-&gt;read())) {
  // skip hidden files
  if($entry[0] == ".") continue;
  if(is_dir("$dir$entry")) {
    $retval[] = array(
      "name" =&gt; "$dir$entry",
      "size" =&gt; 0,
       "Stream" =&gt; md5_file("$dir$entry")
    );
  } elseif(is_readable("$dir$entry")) {
   $retval[] = array(
      "name" =&gt; "$entry",
      "size" =&gt; filesize("$dir$entry"),
     "Stream" =&gt; md5_file("$dir$entry")
    );
  }
  }
 $d-&gt;close();

  return $retval;
 }
 }
 ?&gt;
</code></pre>
