php delete a single file in directory
<p>I've got the php list directory script from this link <a href="http://www.gaijin.at/en/scrphpfilelist.php" rel="nofollow">http://www.gaijin.at/en/scrphpfilelist.php</a>.
How do I delete a single file from the directoy? I tried <code>unlink</code>, but it deleted all the files from that directory. this the short code what i got from the link!</p>

<pre><code>while ($file = readdir ($hDir)) {
if ( ($file != '.') &amp;&amp; ($file != '..') &amp;&amp; (substr($file, 0, 1) != '.') &amp;&amp;
     (strtolower($file) != strtolower(substr($DescFile, -(strlen($file))))) &amp;&amp;
     (!IsFileExcluded($Directory.'/'.$file))
   ) {

  array_push($FilesArray, array('FileName' =&gt; $file,
                                'IsDir' =&gt; is_dir($Directory.'/'.$file),
                                'FileSize' =&gt; filesize($Directory.'/'.$file),
                                'FileTime' =&gt; filemtime($Directory.'/'.$file)
                                ));
}
}
$BaseDir = '../_cron/backup';
$Directory = $BaseDir;

foreach($FilesArray as $file) {
  $FileLink = $Directory.'/'.$file['FileName'];
  if ($OpenFileInNewTab) $LinkTarget = ' target="_blank"'; else $LinkTarget = '';
    echo '&lt;a href="'.$FileLink.'"&gt;'.$FileName.'&lt;/a&gt;';
    echo '&lt;a href="'.unlink($FileLink).'"&gt;&lt;img src="images/icons/delete.gif"&gt;&lt;/a&gt;&lt;/td&gt;';
  }
}
</code></pre>

<p>the list directory folder call : backup.<br>
in the <code>unlink($FileLink)</code>, when i hover the link has change to another folder to admin folder?</p>
