25 lines
744 B
PHP
25 lines
744 B
PHP
|
<?php
|
||
|
header("Access-Control-Allow-Origin: *");
|
||
|
header("Content-Type: application/json; charset=UTF-8");
|
||
|
header("Access-Control-Allow-Methods: POST");
|
||
|
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
|
||
|
|
||
|
require_once('../../utils/config.php');
|
||
|
require_once('../../utils/db.php');
|
||
|
require_once('../../utils/strings.php');
|
||
|
|
||
|
$method = $_SERVER['REQUEST_METHOD'];
|
||
|
if ('POST' === $method) {
|
||
|
parse_str(file_get_contents('php://input'), $_POST);
|
||
|
}
|
||
|
|
||
|
$connection = connect();
|
||
|
|
||
|
$sid = intval($_POST["sid"]);
|
||
|
|
||
|
$querystr = "DELETE FROM li_students WHERE sid=${sid}";
|
||
|
|
||
|
mysqli_query($connection, $querystr);
|
||
|
|
||
|
echo json_encode('{ "result": "true" }');
|
||
|
?>
|