This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
rangitaki/rcc/res/delete_post.php

28 lines
572 B
PHP
Raw Normal View History

2015-12-06 15:19:16 +01:00
<?php
/**
2016-02-16 14:15:21 +01:00
* PHP Version 7
*
2015-12-06 15:19:16 +01:00
* User: mmk2410
* Date: 12/6/15
*
* Error Codes:
* 901 No post given as get argument
* 921 No post with the given name available
* 941 No blog given as get argument
* 961 Error while deleting the post
*/
$post = $_GET["post"];
$blog = $_GET["blog"];
if (!isset($post)) {
echo "901";
} else if (!isset($blog)) {
echo "941";
} else if (!file_exists("./../../articles/$blog/$post.md")) {
echo "921";
} else {
if (unlink("./../../articles/$blog/$post.md")) {
echo "0";
}
echo "961";
}