php code to display list of folders and a delete-button near each of them
<p>I'm a beginner with php and need to write a code that displays a list of folders and a delete-button near each of them, in order to be able to cancel them.
Here's my code: ($array_dir is an array containing the names of the directories in the current folder)</p>

<pre><code>$conto=count($array_dir);
echo"&lt;table&gt;";

for ($b=0;$b&lt;$conto;$b++) {
    echo"&lt;tr&gt;&lt;td&gt;&lt;a href=$array_dir[$b]&gt;".$array_dir[$b].
    "&lt;/a&gt;&lt;br&gt;";
    echo"&lt;form name='delete_dir_".$b."' action=
    '".$_SERVER['PHP_SELF']."' method='GET'&gt;";
    echo"&lt;input type='submit' name='butdelete".$b."' value='Delete'&gt;";
    echo"&lt;/form&gt;&lt;/td&gt;&lt;td&gt;";
    $dir=$array_dir[$b];
    if ((isset($_GET['butdelete".$b."'])) &amp;&amp; ($_GET['butdelete".$b."']==$dir)) {
        if(rmdir($dir)) {
            echo"The directory ".$dir." has been removed";
        }
        else  {
            echo"Could not remove directory ".$dir;
        }
    }
}
</code></pre>

<p>This output looks fine but when I click on the delete-button it doesn't delete the folder and doesn't even return any error. I can't really understand where the error is !</p>
