Location: PHPKode > projects > PHP Site Editor > siteedit2/op_delete.php3
<?php
    include "includes/config.inc.php3";
    include "includes/header.php3";
    include "includes/footer.php3";
    include "includes/site_edit.lib.php3";

    show_header("main");
?>

<table border=0 width=100%>
<tr>
<td>

<?php
    if ($op == "delete") {
        if (is_dir($filepath)) {
            $ret = rmdir($filepath);
            if ($ret != 0) {
                print("$strDeleteFolder");
            } else {
                print("$strDeleteFolderErr");
            }
        } else {
            $ret = unlink($filepath);
            if ($ret != 0) {
                print("$strDeleteFile");
            } else {
                print("$strDeleteFileErr");
            }
        }
    } else {
        $filename = basename($filepath);
        print("$filename - $strDeleteQuest");
        print("<form action=\"op_delete.php3?op=delete&filepath=$filepath\" method=\"post\" target=opwin>");
        print("<input type=\"submit\" value=\"$strDelete\">");
        print("</form>");
    }
?>

</td>
</tr>
</table>

<?php show_footer(); ?>
Return current item: PHP Site Editor