Location: PHPKode > projects > NOLA > docmgmtdelete.php
<? include('includes/main.php'); ?>
<? // docmgmtdelete.php - delete a file from the respository and the db

$recordSet = &$conn->Execute("SELECT status FROM docmgmtdata WHERE id = '$id' AND owner = '$userid' AND status = '0'");
if ($recordSet->EOF) die(texterror('File not found.'));

// delete from db
$conn->Execute("DELETE FROM docmgmtdata WHERE id = '$id'");

// delete from db
$conn->Execute("DELETE FROM docmgmtperms WHERE fid = '$id'");

$conn->Execute("DELETE FROM docmgmtlog WHERE id = '$id'");

// delete from directory
unlink(IMAGE_UPLOAD_DIR . $id . ".dat");

// clean up and back to main page
echo "<a href=\"docmgmtout.php\">Document successfully deleted</a>";
?>
<? include('includes/footer.php'); ?>
Return current item: NOLA