Commit eabedff3 authored by Paarth's avatar Paarth

minor

parent a006484b
...@@ -33,8 +33,7 @@ if(isset($postData) && !empty($postData)){ ...@@ -33,8 +33,7 @@ if(isset($postData) && !empty($postData)){
echo json_encode($msg); echo json_encode($msg);
} }
else{ else{
$msg = "question already exists"; http_response_code(404);
echo json_encode($msg);
} }
} }
......
...@@ -12,7 +12,7 @@ $postData = file_get_contents("php://input"); ...@@ -12,7 +12,7 @@ $postData = file_get_contents("php://input");
if (isset($postData) && !empty($postData)) { if (isset($postData) && !empty($postData)) {
$request = json_decode($postData,true); $request = json_decode($postData,true);
$username = mysqli_real_escape_string($mysqli, trim($request->username)); $username = mysqli_real_escape_string($mysqli, trim($request->username));
$bool = trim($request->) $bool = trim($request->b);
$sql0 = "UPDATE users set n_attempts = n_attempts+1 where username = '$username'"; $sql0 = "UPDATE users set n_attempts = n_attempts+1 where username = '$username'";
mysqli_query($mysqli,$sql0); mysqli_query($mysqli,$sql0);
if($bool){ if($bool){
......
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