Commit bf95b9eb authored by Paarth's avatar Paarth

minor

parent b4c4c11c
<FilesMatch ".(ttf|otf|eot|woff|woff2)$">
<IfModule mod_headers.c>
Allow from all
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
...@@ -4,8 +4,7 @@ include_once("database.php"); ...@@ -4,8 +4,7 @@ include_once("database.php");
$postData = file_get_contents("php://input"); $postData = file_get_contents("php://input");
if (isset($postData) && !empty($postData)) { if (isset($postData) && !empty($postData)) {
// echo $postData;
// exit(0);
$request = json_decode($postData, true); $request = json_decode($postData, true);
$isFile = trim($request['isFile']); $isFile = trim($request['isFile']);
if($isFile){ if($isFile){
...@@ -15,6 +14,8 @@ if (isset($postData) && !empty($postData)) { ...@@ -15,6 +14,8 @@ if (isset($postData) && !empty($postData)) {
$path = '../users/' . $username . '/' . trim($request['file']['path']) . '/' . $filename . $lang; $path = '../users/' . $username . '/' . trim($request['file']['path']) . '/' . $filename . $lang;
if (unlink($path)) { if (unlink($path)) {
$sql = "UPDATE users SET n_files=n_files-1 WHERE username = $username";
mysqli_query($mysqli,$sql);
$msg = "file successfully deleted"; $msg = "file successfully deleted";
echo json_encode($msg); echo json_encode($msg);
......
...@@ -9,9 +9,6 @@ header("Content-Type: application/json; charset=UTF-8"); ...@@ -9,9 +9,6 @@ header("Content-Type: application/json; charset=UTF-8");
include_once("../database.php"); include_once("../database.php");
$postData = file_get_contents("php://input"); $postData = file_get_contents("php://input");
echo $postData;
exit(0);
if(isset($postData) && !empty($postData)){ if(isset($postData) && !empty($postData)){
$request = json_decode($postData); $request = json_decode($postData);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment