check.php 473 B

123456789101112131415161718
  1. <?php
  2. include_once("../auth.php");
  3. if (isset($_GET['rid'])){
  4. if (file_exists("data/" . $_GET['rid'] . ".inf")){
  5. $data = file_get_contents("data/" . $_GET['rid'] . ".inf");
  6. $data = explode(",",$data);
  7. header('Content-Type: application/json');
  8. echo json_encode([true,$data]);
  9. unlink("data/" . $_GET['rid'] . ".inf");
  10. }else{
  11. header('Content-Type: application/json');
  12. echo json_encode([false,""]);
  13. }
  14. }else{
  15. echo "ERROR. rid not given.";
  16. }
  17. ?>