Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #models
- require_once("models/User.php");
- require_once("models/Spot.php");
- static function process(){
- $json = json_decode(file_get_contents("php://input"));
- $function = $json->function;
- switch($function){
- case "login":
- self::login();
- break;
- case "getSpots":
- break;
- }
- $response = json_encode($arr);
- echo $response;
- }
- static function login() {
- $username = $json->username;
- $password = $json->password;
- $login = User::login_js($username,$password);
- if($login == true) {
- $arr = array('succes'=>'true','function' => $function);
- } else {
- $arr = array('succes'=>'false');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement