Advertisement
Guest User

Untitled

a guest
Jan 28th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2. #models
  3. require_once("models/User.php");
  4. require_once("models/Spot.php");
  5.  
  6. $json = json_decode(file_get_contents("php://input"));
  7.  
  8. $function = $json->function;
  9.  
  10. switch($function){
  11. case "login":
  12. $username = $json->username;
  13. $password = $json->password;
  14. $login = User::login_js($username,$password);
  15. if($login == true) {
  16. $arr = array('succes'=>'true','function' => $function);
  17. } else {
  18. $arr = array('succes'=>'false');
  19. }
  20. break;
  21.  
  22. case "getSpots":
  23. break;
  24.  
  25. }
  26.  
  27. $response = json_encode($arr);
  28. echo $response;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement