Advertisement
Guest User

Api server

a guest
Dec 10th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. <?php
  2.  
  3.     if(isset($_POST['data'])){
  4.      
  5.         $f = fopen('users/'.date('d-m-Y-H:i:s').'.txt', 'w');
  6.         fwrite($f, $_POST['data']);
  7.        
  8.         if(fclose($f)){
  9.             echo json_encode(['status' => 'success']);
  10.         }else{
  11.            
  12.             echo json_encode(['status' => 'error']);
  13.         }  
  14.     }
  15.  
  16.        
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement